Changed string view related __cplusplus check to > 201402L, and reverted additional travis tests to reduce the CI duration

This commit is contained in:
eidheim 2018-03-29 10:45:10 +02:00
commit bd9c1192bb
2 changed files with 11 additions and 13 deletions

View file

@ -18,13 +18,5 @@ script:
rm -r * && rm -r * &&
CXX=g++ cmake -DUSE_STANDALONE_ASIO=ON -DCMAKE_CXX_FLAGS=\"-Werror -O3\" .. && CXX=g++ cmake -DUSE_STANDALONE_ASIO=ON -DCMAKE_CXX_FLAGS=\"-Werror -O3\" .. &&
make && make &&
CTEST_OUTPUT_ON_FAILURE=1 make test && CTEST_OUTPUT_ON_FAILURE=1 make test
rm -r * &&
CXX=g++ cmake -DCMAKE_CXX_FLAGS=\"-Werror -std=c++17 -O3\" .. &&
make &&
CTEST_OUTPUT_ON_FAILURE=1 make test &&
rm -r * &&
CXX=g++ cmake -DUSE_STANDALONE_ASIO=ON -DCMAKE_CXX_FLAGS=\"-Werror -std=c++17 -O3\" .. &&
make &&
CTEST_OUTPUT_ON_FAILURE=1 make test
" "

View file

@ -29,14 +29,20 @@ namespace SimpleWeb {
} // namespace SimpleWeb } // namespace SimpleWeb
#endif #endif
#if __cplusplus >= 201402L || (defined(_MSC_VER) && _MSC_VER >= 1910) #if __cplusplus > 201402L || (defined(_MSC_VER) && _MSC_VER >= 1910)
#include <string_view> #include <string_view>
namespace SimpleWeb { using string_view = std::string_view; } namespace SimpleWeb {
using string_view = std::string_view;
}
#elif !defined(USE_STANDALONE_ASIO) #elif !defined(USE_STANDALONE_ASIO)
#include <boost/utility/string_ref.hpp> #include <boost/utility/string_ref.hpp>
namespace SimpleWeb { using string_view = boost::string_ref; } namespace SimpleWeb {
using string_view = boost::string_ref;
}
#else #else
namespace SimpleWeb { using string_view = const std::string &; } namespace SimpleWeb {
using string_view = const std::string &;
}
#endif #endif
namespace SimpleWeb { namespace SimpleWeb {