Supply missing #include. Rewrite typedef tests to avoid GCC warnings.

This commit is contained in:
Beman 2015-07-15 16:15:23 -04:00
parent 270a6c39b5
commit 904e2c3c81
2 changed files with 5 additions and 3 deletions

View File

@ -27,6 +27,7 @@
#include <algorithm> #include <algorithm>
#include <iterator> #include <iterator>
#include <string> #include <string>
#include <cstring>
#include <iosfwd> #include <iosfwd>
namespace boost { namespace boost {
@ -129,7 +130,7 @@ namespace boost {
len_ -= n; len_ -= n;
} }
BOOST_CONSTEXPR void swap(basic_string_view& s) BOOST_NOEXCEPT { /*BOOST_CONSTEXPR*/ void swap(basic_string_view& s) BOOST_NOEXCEPT {
std::swap(ptr_, s.ptr_); std::swap(ptr_, s.ptr_);
std::swap(len_, s.len_); std::swap(len_, s.len_);
} }

View File

@ -464,8 +464,9 @@ namespace
int cpp_main(int argc, char* argv[]) int cpp_main(int argc, char* argv[])
{ {
typedef boost::string_view::traits_type string_traits; // verify traits_type and const_pointer typedefs compile OK
typedef boost::string_view::const_pointer const_pointer; BOOST_TEST(boost::string_view::traits_type::eq('x', 'x'));
BOOST_TEST_EQ(sizeof(boost::string_view::const_pointer), sizeof(&argc));
swap_test(); swap_test();
copy_test(); copy_test();