Adobe Source Libraries  1.43
array.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2013 Adobe
3  Distributed under the Boost Software License, Version 1.0.
4  (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 */
6 /**************************************************************************************************/
7 
8 #ifndef ADOBE_ARRAY_HPP
9 #define ADOBE_ARRAY_HPP
10 
11 #include <adobe/config.hpp>
12 
13 #include <adobe/array_fwd.hpp>
14 
15 #include <adobe/any_regular.hpp>
16 
17 #ifdef ADOBE_STD_SERIALIZATION
18 #include <adobe/iomanip.hpp>
19 #endif
20 
21 /**************************************************************************************************/
22 
23 namespace adobe {
24 
25 /**************************************************************************************************/
26 
27 template <typename T> // T models Regular
28 inline void push_back(array_t& v, T x) {
29  v.push_back(any_regular_t(std::move(x)));
30 }
31 
32 inline void push_back(array_t& v, any_regular_t x) { v.push_back(std::move(x)); }
33 
34 /**************************************************************************************************/
35 
36 #ifdef ADOBE_STD_SERIALIZATION
37 
38 inline std::ostream& operator<<(std::ostream& out, const array_t& x) {
39  out << begin_sequence;
40 
41  for (const auto& e : x)
42  out << format(e);
43 
44  out << end_sequence;
45 
46  return out;
47 }
48 
49 #endif
50 
51 /**************************************************************************************************/
52 
53 } // namespace adobe
54 
55 /**************************************************************************************************/
56 
57 #endif
void push_back(array_t &v, T x)
Definition: array.hpp:28
std::vector< any_regular_t > array_t
Definition: array_fwd.hpp:24
std::ostream & operator<<(std::ostream &out, const array_t &x)
Definition: array.hpp:38