diff --git a/include/fc/function.hpp b/include/fc/function.hpp index 7e316c6..0773a6e 100644 --- a/include/fc/function.hpp +++ b/include/fc/function.hpp @@ -2,11 +2,15 @@ #define _FC_FUNCTION_HPP_ #include #include +#include namespace fc { // place holder for more compile-effecient functor +#if !defined(BOOST_NO_TEMPLATE_ALIASES) template using function = std::function; +#else +#endif } #endif // _FC_FUNCTION_HPP_ diff --git a/include/fc/signals.hpp b/include/fc/signals.hpp index c28c8c6..990a3ea 100644 --- a/include/fc/signals.hpp +++ b/include/fc/signals.hpp @@ -5,8 +5,11 @@ #include namespace fc { +#if !defined(BOOST_NO_TEMPLATE_ALIASES) template using signal = boost::signal; +#else +#endif template inline T wait( boost::signal& sig, const microseconds& timeout_us=microseconds::max() ) { diff --git a/include/fc/utility.hpp b/include/fc/utility.hpp index d556805..0d3159c 100644 --- a/include/fc/utility.hpp +++ b/include/fc/utility.hpp @@ -3,6 +3,8 @@ #include #include +#define nullptr 0 + typedef decltype(sizeof(int)) size_t; namespace std { typedef decltype(sizeof(int)) size_t; diff --git a/src/string.cpp b/src/string.cpp index 4145736..4504e50 100644 --- a/src/string.cpp +++ b/src/string.cpp @@ -46,8 +46,8 @@ namespace fc { ::detail::destroy( this ); } - string::iterator string::begin() { return &reinterpret_cast(this)->front(); } - string::iterator string::end() { return &reinterpret_cast(this)->back() +1; }// my->str.size(); } + string::iterator string::begin() { return &(*this)[0]; } + string::iterator string::end() { return &(*this)[size()]; } string::const_iterator string::begin()const { return reinterpret_cast(this)->c_str(); } string::const_iterator string::end()const { return reinterpret_cast(this)->c_str() + reinterpret_cast(this)->size(); }