stlab.adobe.com Adobe Systems Incorporated
poly_copyable.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2006-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  Author(s): Mat Marcus
7 */
8 
9 /*************************************************************************************************/
10 
11 #ifndef ADOBE_POLY_COPYABLE_HPP
12 #define ADOBE_POLY_COPYABLE_HPP
13 
14 #include <adobe/config.hpp>
15 
16 #include <boost/concept_check.hpp>
17 
18 #include <adobe/poly.hpp>
19 
20 /*************************************************************************************************/
21 
22 namespace adobe {
23 
28 /*************************************************************************************************/
29 
37 template <typename T>
38 struct poly_copyable_instance : optimized_storage_type<T, poly_copyable_interface>::type
39 {
41 
45  BOOST_CLASS_REQUIRE(T, boost, CopyConstructibleConcept);
46 
50  poly_copyable_instance(const T& x) : base_t(x) {}
51 
56  : base_t(move_from<base_t>(x.source)) {}
57 
58 };
59 
60 /*************************************************************************************************/
61 
68 struct copyable : poly_base<poly_copyable_interface, poly_copyable_instance>
69 {
71 
75  template <typename T>
76  explicit copyable(const T& s)
77  : base_t(s) { }
78 
83  : base_t(move_from<base_t>(x.source)) {}
84 };
85 
86 
87 /*************************************************************************************************/
88 
89 #if !defined(ADOBE_NO_DOCUMENTATION)
90 
91 /*************************************************************************************************/
92 
93 typedef poly<copyable> poly_copyable_t;
94 
95 /*************************************************************************************************/
96 
97 #endif
98 
99 /*************************************************************************************************/
100 
101 } // namespace adobe
102 
103 /*************************************************************************************************/
104 
105 #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