summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/strings/string.view/string.view.io/stream_insert_decl_present.pass.cpp
blob: be0567a7372317682ed315dcc2f19cd68337f575 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//

// <string>

// template<class charT, class traits, class Allocator>
//   basic_ostream<charT, traits>&
//   operator<<(basic_ostream<charT, traits>& os,
//              const basic_string_view<charT,traits> str);

#include <string_view>
#include <iosfwd>

template <class SV, class = void>
struct HasDecl : std::false_type {};
template <class SV>
struct HasDecl<SV, decltype(static_cast<void>(std::declval<std::ostream&>() << std::declval<SV&>()))> : std::true_type {};

int main() {
  static_assert(HasDecl<std::string_view>::value, "streaming operator declaration not present");
}
OpenPOWER on IntegriCloud