stlab.adobe.com Adobe Systems Incorporated
regular_concept.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_REGULAR_HPP
10 #define ADOBE_REGULAR_HPP
11 
12 /*************************************************************************************************/
13 
14 #ifdef ADOBE_HAS_CPLUS0X_CONCEPTS
15 
16 /*************************************************************************************************/
17 
18 #include <concepts>
19 
20 /*************************************************************************************************/
21 
22 namespace adobe {
23 
24 /*************************************************************************************************/
25 
26 auto concept RegularConcept<typename T>
27 : std::CopyConstructible<T>,
28  std::Assignable<T>,
29  std::EqualityComparable<T>,
30  std::Swappable<T>,
31  std::DefaultConstructible<T> // not yet
32 {
33 };
34 
35 /*************************************************************************************************/
36 
37 } // namespace adobe
38 
39 /*************************************************************************************************/
40 
41 #else
42 
43 /*************************************************************************************************/
44 
45 #include <boost/concept_check.hpp>
46 
47 /*************************************************************************************************/
48 
49 namespace adobe {
50 
51 /*************************************************************************************************/
52 
53 template <class T>
55 {
56 
57 // Concept checking:
58 
59  void constraints() {
60  // refinement of:
61  boost::function_requires<boost::CopyConstructibleConcept<T> >();
62  boost::function_requires<boost::AssignableConcept<T> >();
63  boost::function_requires<boost::EqualityComparableConcept<T> >();
64  // boost::function_requires<boost::SwappableConcept<T> >();
65 
66  swap(t,t);
67  }
68 #if !defined(ADOBE_NO_DOCUMENTATION)
69  T t;
70 #endif
71 };
72 
73 /*************************************************************************************************/
74 
75 } // namespace adobe
76 
77 /*************************************************************************************************/
78 
79 #endif
80 
81 /*************************************************************************************************/
82 
83 #endif
void swap(circular_queue< T > &, circular_queue< T > &)

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google