Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
size-trait.hpp
Go to the documentation of this file.
1/*
2 SIZE-TRAIT.hpp - helpers and definitions to deal with the size of some known types
3
4 Copyright (C)
5 2011, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
39#ifndef LIB_META_SIZE_TRAIT_H
40#define LIB_META_SIZE_TRAIT_H
41
42
43
44#include <vector>
45#include <string>
46
47
48namespace lib {
49namespace meta {
50
51
78 {
79 //-------------------------------------mimicked-definitions--
80
81 typedef std::vector<size_t> Vector;
82 typedef std::vector<bool> BVector;
83
85 : std::allocator<char>
86 { };
87
88 struct Locale
89 {
90 void* _M_impl;
91 };
92
93 template<class T>
94 struct Optional
95 {
98 };
99
101 {
102 _S_app = 1L << 0,
103 _S_ate = 1L << 1,
104 _S_bin = 1L << 2,
105 _S_in = 1L << 3,
106 _S_out = 1L << 4,
107 _S_trunc = 1L << 5,
108 _S_ios_openmode_end = 1L << 16
109 };
110
112 {
113 char * _M_in_beg;
114 char * _M_in_cur;
115 char * _M_in_end;
119
121
122 virtual ~BasicStringbuf() { }
123 };
124
133
135 {
137 BVector bound_; // note: differs in size
141 mutable bool dumped_;
142 std::string prefix_;
143 unsigned char exceptions;
146 };
147 //-------------------------------------mimicked-definitions--
148
149
150 public:/* ===== Interface: size constants ===== */
151
152 enum { ALIGNMENT = sizeof(size_t)
153
154 , STRING = sizeof(std::string)
155 , VECTOR = sizeof(Vector)
156 , BVECTOR = sizeof(BVector)
157
159 };
160 };
161
162
163}} // namespace lib::meta
164#endif
A collection of constants to describe the expected size of some known classes, without needing to inc...
std::vector< size_t > Vector
std::vector< bool > BVector
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
Implementation namespace for support and library code.