stlab.adobe.com Adobe Systems Incorporated

regular_concept.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_REGULAR_HPP
00010 #define ADOBE_REGULAR_HPP
00011 
00012 /*************************************************************************************************/
00013 
00014 #ifdef ADOBE_HAS_CPLUS0X_CONCEPTS
00015 
00016 /*************************************************************************************************/
00017 
00018 #include <concepts>
00019 
00020 /*************************************************************************************************/
00021 
00022 namespace adobe {
00023     
00024 /*************************************************************************************************/
00025 
00026 auto concept RegularConcept<typename T>
00027 : std::CopyConstructible<T>, 
00028   std::Assignable<T>, 
00029   std::EqualityComparable<T>, 
00030   std::Swappable<T>,
00031   std::DefaultConstructible<T> // not yet
00032 {
00033 };
00034 
00035 /*************************************************************************************************/
00036 
00037 } // namespace adobe
00038 
00039 /*************************************************************************************************/
00040 
00041 #else
00042 
00043 /*************************************************************************************************/
00044 
00045 #include <boost/concept_check.hpp>
00046 
00047 /*************************************************************************************************/
00048 
00049 namespace adobe {
00050 
00051 /*************************************************************************************************/
00052 
00053 template <class T>
00054 struct RegularConcept
00055 {
00056 
00057 // Concept checking:
00058 
00059     void constraints() {
00060         // refinement of:
00061         boost::function_requires<boost::CopyConstructibleConcept<T> >();
00062         boost::function_requires<boost::AssignableConcept<T> >();
00063         boost::function_requires<boost::EqualityComparableConcept<T> >();
00064         boost::function_requires<boost::DefaultConstructibleConcept<T> >();
00065         //        boost::function_requires<boost::SwappableConcept<T> >();
00066 
00067         swap(t,t);
00068     }
00069 #if !defined(ADOBE_NO_DOCUMENTATION)
00070     T t;
00071 #endif
00072 };
00073 
00074 /*************************************************************************************************/
00075 
00076 } // namespace adobe
00077 
00078 /*************************************************************************************************/
00079 
00080 #endif
00081 
00082 /*************************************************************************************************/
00083 
00084 #endif

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