c++17 string_view support
This commit is contained in:
parent
1985c5941d
commit
5324abea8c
6 changed files with 13 additions and 14 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -21,3 +21,6 @@ io_test
|
|||
parse_test
|
||||
crypto_test
|
||||
status_code_test
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"CurrentProjectSetting": "x86-Debug"
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
BIN
.vs/slnx.sqlite
BIN
.vs/slnx.sqlite
Binary file not shown.
|
|
@ -16,16 +16,6 @@ namespace SimpleWeb {
|
|||
using errc = std::errc;
|
||||
using system_error = std::system_error;
|
||||
namespace make_error_code = std;
|
||||
#ifdef __has_include
|
||||
#if __has_include(<string_view>)
|
||||
#include<string_view>
|
||||
using string_view = std::string_view;
|
||||
#define __has_string_view 1
|
||||
#endif
|
||||
#endif
|
||||
#ifndef __has_string_view
|
||||
using string_view = const std::string &;
|
||||
#endif
|
||||
} // namespace SimpleWeb
|
||||
#else
|
||||
#include <boost/asio.hpp>
|
||||
|
|
@ -37,10 +27,19 @@ namespace SimpleWeb {
|
|||
namespace errc = boost::system::errc;
|
||||
using system_error = boost::system::system_error;
|
||||
namespace make_error_code = boost::system::errc;
|
||||
using string_view = boost::string_ref;
|
||||
} // namespace SimpleWeb
|
||||
#endif
|
||||
|
||||
#if defined(__has_include) && __has_include(<string_view>)
|
||||
#include <string_view>
|
||||
namespace SimpleWeb { using string_view = std::string_view; }
|
||||
#elif !defined(USE_STANDALONE_ASIO)
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
namespace SimpleWeb { using string_view = boost::string_ref; }
|
||||
#else
|
||||
namespace SimpleWeb { using string_view = const std::string &; }
|
||||
#endif
|
||||
|
||||
namespace SimpleWeb {
|
||||
template <class socket_type>
|
||||
class Client;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue