//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++98, c++03, c++11 // // // template > // class ostream_joiner; // // ostream_joiner & operator*() noexcept // returns *this; #include #include #include #include "test_macros.h" namespace exper = std::experimental; template void test ( exper::ostream_joiner &oj ) { static_assert((noexcept(*oj)), "" ); exper::ostream_joiner &ret = *oj; assert( &ret == &oj ); } int main(int, char**) { { exper::ostream_joiner oj(std::cout, '8'); test(oj); } { exper::ostream_joiner oj(std::cout, std::string("9")); test(oj); } { exper::ostream_joiner oj(std::cout, std::wstring(L"10")); test(oj); } { exper::ostream_joiner oj(std::cout, 11); test(oj); } { exper::ostream_joiner oj(std::wcout, '8'); test(oj); } { exper::ostream_joiner oj(std::wcout, std::string("9")); test(oj); } { exper::ostream_joiner oj(std::wcout, std::wstring(L"10")); test(oj); } { exper::ostream_joiner oj(std::wcout, 11); test(oj); } return 0; }