123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- #ifndef BOOST_MYSQL_CONSTANT_STRING_VIEW_HPP
- #define BOOST_MYSQL_CONSTANT_STRING_VIEW_HPP
- #include <boost/mysql/string_view.hpp>
- #include <boost/mysql/detail/config.hpp>
- #include <boost/config.hpp>
- #include <type_traits>
- namespace boost {
- namespace mysql {
- class constant_string_view
- {
- string_view impl_;
- #ifndef BOOST_MYSQL_DOXYGEN
- constexpr constant_string_view(string_view value, int) noexcept : impl_(value) {}
- friend constexpr constant_string_view runtime(string_view) noexcept;
- #endif
- public:
-
- template <
- class T
- #ifndef BOOST_MYSQL_DOXYGEN
- ,
- class = typename std::enable_if<std::is_convertible<const T&, string_view>::value>::type
- #endif
- >
- BOOST_MYSQL_CONSTEVAL constant_string_view(const T& value) noexcept : impl_(value)
- {
- }
-
- constexpr string_view get() const noexcept { return impl_; }
- };
- constexpr constant_string_view runtime(string_view value) noexcept { return constant_string_view(value, 0); }
- }
- }
- #endif
|