// Copyright (C) 2015-2020 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the // terms of the GNU General Public License as published by the // Free Software Foundation; either version 3, or (at your option) // any later version. // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License along // with this library; see the file COPYING3. If not see // . // { dg-do compile { target c++14 } } #include using namespace std::experimental::net; using std::vector; using std::string; using std::char_traits; using std::allocator; template struct Seq { struct Buf { operator T() const { return {}; } }; Buf* begin() const { return nullptr; } Buf* end() const { return nullptr; } }; static_assert( is_mutable_buffer_sequence::value, "mutable_buffer is a mutable buffer sequence" ); static_assert( is_mutable_buffer_sequence::value, "const mutable_buffer is a mutable buffer sequence" ); static_assert( is_mutable_buffer_sequence>::value, "vector is a mutable buffer sequence" ); static_assert( is_mutable_buffer_sequence>::value, "const vector is a mutable buffer sequence" ); static_assert( is_mutable_buffer_sequence>::value, "Seq is a mutable buffer sequence" ); static_assert( is_mutable_buffer_sequence>::value, "const Seq is a mutable buffer sequence" ); static_assert( is_mutable_buffer_sequence>::value, "Seq is a mutable buffer sequence" ); static_assert( ! is_mutable_buffer_sequence::value, "const_buffer is not a mutable buffer sequence" ); static_assert( ! is_mutable_buffer_sequence>::value, "vector is not a mutable buffer sequence" ); static_assert( ! is_mutable_buffer_sequence>::value, "Seq is not a mutable buffer sequence" ); static_assert( is_const_buffer_sequence::value, "const_buffer is a const buffer sequence" ); static_assert( is_const_buffer_sequence::value, "const const_buffer is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "vector is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "const vector is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "Seq is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "const Seq is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "Seq is a const buffer sequence" ); static_assert( is_const_buffer_sequence::value, "mutable_buffer is a const buffer sequence" ); static_assert( is_const_buffer_sequence::value, "const mutable_buffer is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "vector is a const buffer sequence" ); static_assert( is_const_buffer_sequence>::value, "const vector is a const buffer sequence" ); // Buf -> mutable_buffer -> const_buffer needs two user-defined conversions: static_assert( ! is_const_buffer_sequence>::value, "Seq is not a const buffer sequence" ); static_assert( is_dynamic_buffer< dynamic_vector_buffer> >::value, "dynamic_vector_buffer is a dynamic buffer" ); static_assert( is_dynamic_buffer< dynamic_string_buffer, allocator> >::value, "dynamic_string_buffer is a dynamic buffer" ); static_assert( ! is_dynamic_buffer>::value, "vector is not a dynamic buffer" ); static_assert( ! is_dynamic_buffer::value, "string is not a dynamic buffer" );