Skip to content

Commit ed3952b

Browse files
author
roman_yakovenko
committed
updating type_traits functionality
1 parent e908b80 commit ed3952b

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

unittests/data/type_traits.hpp

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,12 @@ namespace detail{
156156

157157
struct const_item{ const int values[10]; };
158158

159+
void test_const_item(const_item by_value);
160+
159161
struct const_container{ const const_item items[10]; };
160162

163+
void test_const_container(const_container by_value);
164+
161165
enum semantic{ position, normal, binormal };
162166
enum element_type{ float_, color, short_ };
163167

@@ -182,9 +186,7 @@ namespace yes{
182186
typedef detail::d_t d_t;
183187
typedef detail::dd_t dd_t;
184188
typedef detail::f_t f_t;
185-
typedef detail::g_t g_t;
186-
typedef detail::const_item const_item_t;
187-
typedef detail::const_container const_container_t;
189+
typedef detail::g_t g_t;
188190
}
189191
namespace no{
190192
typedef std::string string_type;
@@ -193,6 +195,9 @@ namespace no{
193195
typedef std::set< std::string > string_set_type;
194196
typedef std::multimap< std::string, std::string > s2s_multimap_type;
195197
typedef detail::vertex vertex_type;
198+
typedef detail::const_container const_container_t;
199+
typedef detail::const_item const_item_t;
200+
196201
}
197202
}
198203

@@ -523,20 +528,31 @@ namespace no{
523528

524529
namespace has_trivial_constructor{
525530

531+
namespace details{
532+
533+
struct const_item{ const int values[10]; };
534+
535+
void test_const_item( const_item x = const_item() );
536+
537+
struct const_container{ const const_item items[10]; };
538+
539+
void test_const_container( const_container x = const_container() );
540+
541+
}
542+
526543
namespace yes{
527544
struct x{
528545
x(){}
529546
};
547+
typedef details::const_item const_item;
548+
typedef details::const_container const_container;
530549
}
531550

532551
namespace no{
533552
class y{
534553
private:
535554
y(){}
536555
};
537-
538-
struct const_item{ const int values[10]; };
539-
struct const_container{ const const_item items[10]; };
540556

541557
class singleton_t
542558
{

0 commit comments

Comments
 (0)