string_view.fail.cpp 668 B

1234567891011121314151617181920212223
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // <string>
  10. // explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator());
  11. #include <string>
  12. #include <string_view>
  13. void foo ( const string &s ) {}
  14. int main()
  15. {
  16. std::string_view sv = "ABCDE";
  17. foo(sv); // requires implicit conversion from string_view to string
  18. }