Adobe Source Libraries 2.0.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
poly_copyable.hpp
Go to the documentation of this file.
1/*
2 Copyright 2006-2007 Adobe Systems Incorporated
3 Distributed under the Boost Software License - Version 1.0 (see the accompanying file LICENSE
4 or a copy at https://stlab.github.io/adobe_source_libraries/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
22namespace adobe {
23
27
28/**************************************************************************************************/
29
36
37template <typename T>
38struct poly_copyable_instance : optimized_storage_type<T, poly_copyable_interface>::type {
40
44 BOOST_CLASS_REQUIRE(T, boost, CopyConstructibleConcept);
45
49 poly_copyable_instance(const T& x) : base_t(x) {}
50
54 poly_copyable_instance(poly_copyable_instance&& x) noexcept : base_t(std::move(x)) {}
55};
56
57/**************************************************************************************************/
58
64
65struct copyable : poly_base<poly_copyable_interface, poly_copyable_instance> {
67
71 template <typename T>
72 explicit copyable(const T& s) : base_t(s) {}
73
77 copyable(copyable&& x) noexcept : base_t(std::move(x)) {}
78};
79
80
81/**************************************************************************************************/
82
83#if !defined(ADOBE_NO_DOCUMENTATION)
84
85/**************************************************************************************************/
86
88
89/**************************************************************************************************/
90
91#endif
92
93/**************************************************************************************************/
94
95} // namespace adobe
96
97/**************************************************************************************************/
98
99#endif
poly<foo> will be a runtime polymorphic value type wrapper modelling a concept represented by foo
Definition poly.hpp:406
poly< copyable > poly_copyable_t
copyable(const T &s)
copyable(copyable &&x) noexcept
poly_base< poly_copyable_interface, poly_copyable_instance > base_t
Authors of poly concept representatives must derive their instance class from this....
Definition poly.hpp:241
optimized_storage_type< T, poly_copyable_interface >::type base_t
BOOST_CLASS_REQUIRE(T, boost, CopyConstructibleConcept)
poly_copyable_instance(poly_copyable_instance &&x) noexcept