Moved SimpleWeb::string_view to utility.hpp, and made use of string_view in Server::Response::write
This commit is contained in:
parent
0ae69bffb1
commit
56b1df1ee5
5 changed files with 20 additions and 20 deletions
16
utility.hpp
16
utility.hpp
|
|
@ -8,6 +8,22 @@
|
|||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
#if __cplusplus > 201402L || (defined(_MSC_VER) && _MSC_VER >= 1910)
|
||||
#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 {
|
||||
inline bool case_insensitive_equal(const std::string &str1, const std::string &str2) noexcept {
|
||||
return str1.size() == str2.size() &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue