ports for gcc-4.6, lack of template alias
This commit is contained in:
parent
c7ce00202a
commit
f90a57ba40
4 changed files with 11 additions and 2 deletions
|
|
@ -2,11 +2,15 @@
|
||||||
#define _FC_FUNCTION_HPP_
|
#define _FC_FUNCTION_HPP_
|
||||||
#include <fc/utility.hpp>
|
#include <fc/utility.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <boost/config.hpp>
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
// place holder for more compile-effecient functor
|
// place holder for more compile-effecient functor
|
||||||
|
#if !defined(BOOST_NO_TEMPLATE_ALIASES)
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using function = std::function<T>;
|
using function = std::function<T>;
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _FC_FUNCTION_HPP_
|
#endif // _FC_FUNCTION_HPP_
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,11 @@
|
||||||
#include <fc/thread.hpp>
|
#include <fc/thread.hpp>
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
|
#if !defined(BOOST_NO_TEMPLATE_ALIASES)
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using signal = boost::signal<T>;
|
using signal = boost::signal<T>;
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline T wait( boost::signal<void(T)>& sig, const microseconds& timeout_us=microseconds::max() ) {
|
inline T wait( boost::signal<void(T)>& sig, const microseconds& timeout_us=microseconds::max() ) {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
|
#define nullptr 0
|
||||||
|
|
||||||
typedef decltype(sizeof(int)) size_t;
|
typedef decltype(sizeof(int)) size_t;
|
||||||
namespace std {
|
namespace std {
|
||||||
typedef decltype(sizeof(int)) size_t;
|
typedef decltype(sizeof(int)) size_t;
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ namespace fc {
|
||||||
::detail::destroy( this );
|
::detail::destroy( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
string::iterator string::begin() { return &reinterpret_cast<std::string*>(this)->front(); }
|
string::iterator string::begin() { return &(*this)[0]; }
|
||||||
string::iterator string::end() { return &reinterpret_cast<std::string*>(this)->back() +1; }// my->str.size(); }
|
string::iterator string::end() { return &(*this)[size()]; }
|
||||||
string::const_iterator string::begin()const { return reinterpret_cast<const std::string*>(this)->c_str(); }
|
string::const_iterator string::begin()const { return reinterpret_cast<const std::string*>(this)->c_str(); }
|
||||||
string::const_iterator string::end()const { return reinterpret_cast<const std::string*>(this)->c_str() + reinterpret_cast<const std::string*>(this)->size(); }
|
string::const_iterator string::end()const { return reinterpret_cast<const std::string*>(this)->c_str() + reinterpret_cast<const std::string*>(this)->size(); }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue