initializer_list.pass.cpp 594 B

1234567891011121314151617181920212223242526
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. // <string>
  10. // basic_string& assign(initializer_list<charT> il);
  11. #include <string>
  12. #include <cassert>
  13. int main()
  14. {
  15. #ifdef _LIBCPP_MOVE
  16. {
  17. std::string s("123");
  18. s.assign({'a', 'b', 'c'});
  19. assert(s == "abc");
  20. }
  21. #endif
  22. }