summaryrefslogtreecommitdiffstats
path: root/libcxx/include/string_view
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/string_view')
-rw-r--r--libcxx/include/string_view4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/string_view b/libcxx/include/string_view
index 8be61328e8d..5c42b36ca56 100644
--- a/libcxx/include/string_view
+++ b/libcxx/include/string_view
@@ -199,6 +199,10 @@ public:
typedef ptrdiff_t difference_type;
static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
+ static_assert(is_pod<value_type>::value, "Character type of basic_string_view must be a POD");
+ static_assert((is_same<_CharT, typename traits_type::char_type>::value),
+ "traits_type::char_type must be the same type as CharT");
+
// [string.view.cons], construct/copy
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {}
OpenPOWER on IntegriCloud