diff --git a/.travis.yml b/.travis.yml index 6aa2a24..c0c0bbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,17 +10,15 @@ addons: apt: sources: - ubuntu-toolchain-r-test - - george-edison55/cmake-3.x packages: - - gcc-6 - - g++-6 + - gcc-7 + - g++-7 + - gcc-7-multilib + - g++-7-multilib - libboost-dev - - gcc-multilib - - gcc-6-multilib - - g++-multilib - - g++-6-multilib - libc6-dev-i386 - libc6-i386 + - linux-libc-dev:i386 - cxxtest - cmake @@ -29,7 +27,7 @@ before_install: - lsb_release -c - lsb_release -r install: - - if [ "$CXX" = "g++" ]; then export CXX="g++-6" CC="gcc-6"; fi + - if [ "$CXX" = "g++" ]; then export CXX="g++-7" CC="gcc-7"; fi before_script: - cmake --version - cmake . diff --git a/src/helper/shared.h b/src/helper/shared.h index 8939711..825dacd 100644 --- a/src/helper/shared.h +++ b/src/helper/shared.h @@ -16,21 +16,31 @@ #define COLD #endif -#include -#include +#if __has_include() + #include + #include -namespace up -{ - template - using shared_ptr = boost::local_shared_ptr; + namespace up + { + template + using shared_ptr = boost::local_shared_ptr; - template - inline auto make_shared(Args&&... args) + template + inline auto make_shared(Args&&... args) + { + return boost::make_local_shared(std::forward(args)...); + } + } +#else + #include + + namespace up { - return boost::make_local_shared(std::forward(args)...); + using std::shared_ptr; + using std::make_shared; } +#endif -} // Here we can put typedefs that shared by many files #endif // SHARED_H