boost_no_cxx11_hdr_regex.ipp 778 B

1234567891011121314151617181920212223242526272829
  1. // (C) Copyright Beman Dawes 2009
  2. // Copyright (c) Microsoft Corporation
  3. // Use, modification and distribution are subject to the
  4. // Boost Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. // See http://www.boost.org/libs/config for more information.
  7. // MACRO: BOOST_NO_CXX11_HDR_REGEX
  8. // TITLE: C++0x header <regex> unavailable
  9. // DESCRIPTION: The standard library does not supply C++0x header <regex>
  10. #include <regex>
  11. namespace boost_no_cxx11_hdr_regex {
  12. int test()
  13. {
  14. using std::regex;
  15. using std::wregex;
  16. regex e("\\d+");
  17. wregex we(L"\\d+");
  18. std::string s("123456");
  19. std::wstring ws(L"123456");
  20. return regex_match(s, e) && regex_match(ws, we) ? 0 : 1;
  21. }
  22. }