]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/regex/test/concepts/concept_check.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / regex / test / concepts / concept_check.cpp
CommitLineData
7c673cae
FG
1/*
2 *
3 * Copyright (c) 2003
4 * John Maddock
5 *
6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 *
10 */
11
12#include <boost/config.hpp>
13
14#if defined(BOOST_MSVC)
15// this lets us compile at warning level 4 without seeing concept-check related warnings
16# pragma warning(disable:4100)
17#endif
20effc67 18#ifdef BOOST_BORLANDC
7c673cae
FG
19#pragma option -w-8019 -w-8004 -w-8008
20#endif
21#ifdef BOOST_INTEL
22#pragma warning(disable:1418 981 983 595 383)
23#endif
24
25#include <boost/regex.hpp>
26#include <boost/detail/workaround.hpp>
27#if !BOOST_WORKAROUND(_MSC_VER, < 1310) && !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__GNUC__, < 3)
28#include <boost/regex/concepts.hpp>
29#endif
30
31
32int main()
33{
34 // VC6 and VC7 can't cope with the iterator architypes,
35 // don't bother testing as it doesn't work:
36#if !BOOST_WORKAROUND(_MSC_VER, < 1310) && !defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(__IBMCPP__) && !BOOST_WORKAROUND(__GNUC__, < 3)
37 boost::function_requires<
38 boost::RegexTraitsConcept<
39 boost::regex_traits<char>
40 >
41 >();
42#ifndef BOOST_NO_STD_LOCALE
43 boost::function_requires<
44 boost::BoostRegexConcept<
45 boost::basic_regex<char, boost::cpp_regex_traits<char> >
46 >
47 >();
48#ifndef BOOST_NO_WREGEX
49 boost::function_requires<
50 boost::BoostRegexConcept<
51 boost::basic_regex<wchar_t, boost::cpp_regex_traits<wchar_t> >
52 >
53 >();
54#endif
55#endif
20effc67 56#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560)
7c673cae
FG
57 boost::function_requires<
58 boost::BoostRegexConcept<
59 boost::basic_regex<char, boost::c_regex_traits<char> >
60 >
61 >();
62#ifndef BOOST_NO_WREGEX
63 boost::function_requires<
64 boost::BoostRegexConcept<
65 boost::basic_regex<wchar_t, boost::c_regex_traits<wchar_t> >
66 >
67 >();
68#endif
69#endif
70#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
71 boost::function_requires<
72 boost::BoostRegexConcept<
73 boost::basic_regex<char, boost::w32_regex_traits<char> >
74 >
75 >();
76#ifndef BOOST_NO_WREGEX
77 boost::function_requires<
78 boost::BoostRegexConcept<
79 boost::basic_regex<wchar_t, boost::w32_regex_traits<wchar_t> >
80 >
81 >();
82#endif
83#endif
84 //
85 // now test the regex_traits concepts:
86 //
87 typedef boost::basic_regex<char, boost::regex_traits_architype<char> > regex_traits_tester_type1;
88 boost::function_requires<
89 boost::BoostRegexConcept<
90 regex_traits_tester_type1
91 >
92 >();
93#if !defined(__MWERKS__) && !defined(__SUNPRO_CC) // MWCW tries to instantiate std::basic_string<boost::char_architype>, not sure whose bug this is....
94 typedef boost::basic_regex<boost::char_architype, boost::regex_traits_architype<boost::char_architype> > regex_traits_tester_type2;
95 boost::function_requires<
96 boost::BaseRegexConcept<
97 regex_traits_tester_type2
98 >
99 >();
100#endif // __MWERKS__
101#endif
102 return 0;
103}
104
105