34#ifndef _RWSTD_NO_EXT_CXX_0X
109template <
class T,
class U>
212 const char* trait,
const char* type)
215 "%s<%s>::value is %b, expected %b",
216 trait, type,
value, expect);
220 const char* trait,
const char* type,
221 size_t value,
size_t expect)
224 "%s<%s>::value is %zu, expected %zu",
225 trait, type,
value, expect);
229 size_t value,
size_t expect,
230 const char* trait,
const char* type)
233 "%s<%s,%zu>::value is %zu, expected %zu",
238#define _TEST(Trait, Type, Expect) \
239 test_trait (__LINE__, Trait< Type >::value, Expect, #Trait, #Type)
241#define TEST(Trait, Type, Expect) \
242 _TEST (Trait, Type, Expect)
248#define CV const volatile
254 TEST (std::is_const,
void,
false);
255 TEST (std::is_const,
C void,
true);
256 TEST (std::is_const,
V void,
false);
257 TEST (std::is_const,
CV void,
true);
260 TEST (std::is_const, incomplete_t,
false);
261 TEST (std::is_const,
C incomplete_t,
true);
262 TEST (std::is_const,
V incomplete_t,
false);
263 TEST (std::is_const,
CV incomplete_t,
true);
265 TEST (std::is_const,
int,
false);
266 TEST (std::is_const,
C int,
true);
267 TEST (std::is_const,
V int,
false);
268 TEST (std::is_const,
CV int,
true);
271 TEST (std::is_const,
int*,
false);
272 TEST (std::is_const,
C int*,
false);
273 TEST (std::is_const,
V int*,
false);
274 TEST (std::is_const,
CV int*,
false);
276 TEST (std::is_const,
int*
C,
true);
277 TEST (std::is_const,
C int*
C,
true);
278 TEST (std::is_const,
V int*
C,
true);
279 TEST (std::is_const,
CV int*
C,
true);
281 TEST (std::is_const,
int*
V,
false);
282 TEST (std::is_const,
C int*
V,
false);
283 TEST (std::is_const,
V int*
V,
false);
284 TEST (std::is_const,
CV int*
V,
false);
286 TEST (std::is_const,
int*
CV,
true);
287 TEST (std::is_const,
C int*
CV,
true);
288 TEST (std::is_const,
V int*
CV,
true);
289 TEST (std::is_const,
CV int*
CV,
true);
292 TEST (std::is_const,
int&,
false);
293 TEST (std::is_const,
C int&,
false);
294 TEST (std::is_const,
V int&,
false);
295 TEST (std::is_const,
CV int&,
false);
298 TEST (std::is_const,
int [],
false);
299 TEST (std::is_const,
C int [],
true);
300 TEST (std::is_const,
V int [],
false);
301 TEST (std::is_const,
CV int [],
true);
303 TEST (std::is_const,
int [2],
false);
304 TEST (std::is_const,
C int [2],
true);
305 TEST (std::is_const,
V int [2],
false);
306 TEST (std::is_const,
CV int [2],
true);
309 TEST (std::is_const, incomplete_t [],
false);
310 TEST (std::is_const,
C incomplete_t [],
true);
311 TEST (std::is_const,
V incomplete_t [],
false);
312 TEST (std::is_const,
CV incomplete_t [],
true);
315 TEST (std::is_const,
void (),
false);
318 TEST (std::is_const,
void (
struct_t::*)()
const,
false);
324 TEST (std::is_volatile,
void,
false);
325 TEST (std::is_volatile,
C void,
false);
326 TEST (std::is_volatile,
V void,
true);
327 TEST (std::is_volatile,
CV void,
true);
330 TEST (std::is_volatile, incomplete_t,
false);
331 TEST (std::is_volatile,
C incomplete_t,
false);
332 TEST (std::is_volatile,
V incomplete_t,
true);
333 TEST (std::is_volatile,
CV incomplete_t,
true);
335 TEST (std::is_volatile,
int,
false);
336 TEST (std::is_volatile,
C int,
false);
337 TEST (std::is_volatile,
V int,
true);
338 TEST (std::is_volatile,
CV int,
true);
341 TEST (std::is_volatile,
int*,
false);
342 TEST (std::is_volatile,
C int*,
false);
343 TEST (std::is_volatile,
V int*,
false);
344 TEST (std::is_volatile,
CV int*,
false);
346 TEST (std::is_volatile,
int*
C,
false);
347 TEST (std::is_volatile,
C int*
C,
false);
348 TEST (std::is_volatile,
V int*
C,
false);
349 TEST (std::is_volatile,
CV int*
C,
false);
351 TEST (std::is_volatile,
int*
V,
true);
352 TEST (std::is_volatile,
C int*
V,
true);
353 TEST (std::is_volatile,
V int*
V,
true);
354 TEST (std::is_volatile,
CV int*
V,
true);
356 TEST (std::is_volatile,
int*
CV,
true);
357 TEST (std::is_volatile,
C int*
CV,
true);
358 TEST (std::is_volatile,
V int*
CV,
true);
359 TEST (std::is_volatile,
CV int*
CV,
true);
362 TEST (std::is_volatile,
int&,
false);
363 TEST (std::is_volatile,
C int&,
false);
364 TEST (std::is_volatile,
V int&,
false);
365 TEST (std::is_volatile,
CV int&,
false);
368 TEST (std::is_volatile,
int [],
false);
369 TEST (std::is_volatile,
C int [],
false);
370 TEST (std::is_volatile,
V int [],
true);
371 TEST (std::is_volatile,
CV int [],
true);
373 TEST (std::is_volatile,
int [2],
false);
374 TEST (std::is_volatile,
C int [2],
false);
375 TEST (std::is_volatile,
V int [2],
true);
376 TEST (std::is_volatile,
CV int [2],
true);
379 TEST (std::is_volatile, incomplete_t [],
false);
380 TEST (std::is_volatile,
C incomplete_t [],
false);
381 TEST (std::is_volatile,
V incomplete_t [],
true);
382 TEST (std::is_volatile,
CV incomplete_t [],
true);
385 TEST (std::is_volatile,
void (),
false);
388 TEST (std::is_volatile,
void (
struct_t::*)()
volatile,
false);
392static void test_has_trivial_assign ()
394 TEST (std::has_trivial_assign,
long,
true);
395 TEST (std::has_trivial_assign,
C long,
false);
396 TEST (std::has_trivial_assign,
V long,
true);
397 TEST (std::has_trivial_assign,
CV long,
false);
399 TEST (std::has_trivial_assign,
long&,
false);
400 TEST (std::has_trivial_assign,
C long&,
false);
401 TEST (std::has_trivial_assign,
V long&,
false);
402 TEST (std::has_trivial_assign,
CV long&,
false);
404 TEST (std::has_trivial_assign,
long [2],
false);
406#if defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
407 || defined (_RWSTD_TT_IS_POD)
411 "portions of test_has_trivial_assign() have been disabled "
412 "due to lack of compiler support.");
419#if defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN)
425 "portions of test_has_trivial_assign() have been disabled "
426 "due to lack of compiler support.");
433static void test_has_nothrow_assign ()
435 TEST (std::has_nothrow_assign,
long,
true);
436 TEST (std::has_nothrow_assign,
C long,
false);
437 TEST (std::has_nothrow_assign,
V long,
true);
438 TEST (std::has_nothrow_assign,
CV long,
false);
440 TEST (std::has_nothrow_assign,
long&,
false);
441 TEST (std::has_nothrow_assign,
C long&,
false);
442 TEST (std::has_nothrow_assign,
V long&,
false);
443 TEST (std::has_nothrow_assign,
CV long&,
false);
445 TEST (std::has_nothrow_assign,
long [2],
false);
447#if defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN) \
448 || defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
449 || defined (_RWSTD_TT_IS_POD)
451 TEST (std::has_nothrow_assign,
volatile struct_t,
true);
454 "portions of test_has_nothrow_assign() have been disabled "
455 "due to lack of compiler support.");
462#if defined (_RWSTD_TT_HAS_NOTHROW_ASSIGN)
468 "portions of test_has_nothrow_assign() have been disabled "
469 "due to lack of compiler support.");
475static void test_is_trivial ()
477 TEST (std::is_trivial,
void,
false);
478 TEST (std::is_trivial,
C void,
false);
479 TEST (std::is_trivial,
V void,
false);
480 TEST (std::is_trivial,
CV void,
false);
482 TEST (std::is_trivial,
long,
true);
483 TEST (std::is_trivial,
C long,
true);
484 TEST (std::is_trivial,
V long,
true);
485 TEST (std::is_trivial,
CV long,
true);
487 TEST (std::is_trivial,
long&,
false);
488 TEST (std::is_trivial,
C long&,
false);
489 TEST (std::is_trivial,
V long&,
false);
490 TEST (std::is_trivial,
CV long&,
false);
492#if ( defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
493 && defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
494 && defined (_RWSTD_TT_HAS_TRIVIAL_ASSIGN) \
495 && defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)) \
496 || defined (_RWSTD_TT_IS_POD)
508 "portions of test_is_trivial() have been disabled "
509 "due to lack of compiler support.");
528#define TEST(Trait,Type,Expect) \
529 _TEST(Trait, Type, Expect); \
530 _TEST(Trait, std::add_const< Type >::type, Expect); \
531 _TEST(Trait, std::add_volatile< Type >::type, Expect); \
532 _TEST(Trait, std::add_cv< Type >::type, Expect)
534static void test_is_standard_layout ()
536 TEST (std::is_standard_layout,
long,
true);
568 TEST (std::is_standard_layout, derived_from_empty_with_member,
false);
570#if defined (_RWSTD_TT_IS_STANDARD_LAYOUT) \
571 || defined (_RWSTD_TT_IS_POD)
574# if defined (_RWSTD_TT_STRICT_CXX_0X_CONFORM)
578 TEST (std::is_standard_layout,
585 "portions of test_is_standard_layout() have been disabled "
586 "due to lack of compiler support.");
591 TEST (std::is_standard_layout, derived_from_non_empty_with_member,
false);
602static void test_is_pod ()
604 TEST (std::is_pod,
long,
true);
605 TEST (std::is_pod,
long [],
true);
606 TEST (std::is_pod,
long [2],
true);
607 TEST (std::is_pod,
long (*) [2],
true);
609 TEST (std::is_pod,
void*,
true);
610 TEST (std::is_pod,
void (*)(),
true);
611 TEST (std::is_pod,
void (* [])(),
true);
614#if defined (_RWSTD_TT_IS_POD)
624# if defined (_RWSTD_TT_STRICT_CXX_0X_CONFORM)
631 "portions of test_is_pod() have been disabled "
632 "due to lack of compiler support.");
649static void test_is_empty ()
651 TEST (std::is_empty,
void,
false);
660#if defined(_RWSTD_TT_IS_EMPTY) \
661 || defined (_RWSTD_TT_IS_CLASS) \
662 || defined (_RWSTD_TT_IS_UNION)
667 "portions of test_is_empty() have been disabled "
668 "due to lack of compiler support.");
684static void test_is_polymorphic ()
690 TEST (std::is_polymorphic,
void,
false);
691 TEST (std::is_polymorphic,
long,
false);
692 TEST (std::is_polymorphic,
int*,
false);
697#if defined (_RWSTD_TT_IS_POLYMORPHIC) \
698 || defined (_RWSTD_TT_IS_CLASS) \
699 || defined (_RWSTD_TT_IS_UNION)
704 "portions of test_is_polymorphic() have been disabled "
705 "due to lack of compiler support.");
712static void test_is_abstract ()
718 TEST (std::is_abstract,
void,
false);
719 TEST (std::is_abstract,
long,
false);
720 TEST (std::is_abstract,
int*,
false);
725#if defined (_RWSTD_TT_IS_ABSTRACT) \
726 || defined (_RWSTD_TT_IS_CLASS) \
727 || defined (_RWSTD_TT_IS_UNION)
732 "portions of test_is_abstract() have been disabled "
733 "due to lack of compiler support.");
737static void test_has_trivial_constructor ()
739 TEST (std::has_trivial_default_constructor,
long,
true);
740 TEST (std::has_trivial_default_constructor,
const long,
true);
741 TEST (std::has_trivial_default_constructor,
volatile long,
true);
742 TEST (std::has_trivial_default_constructor,
long&,
false);
743 TEST (std::has_trivial_default_constructor,
long [2],
true);
745#if defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
746 || defined (_RWSTD_TT_IS_POD)
747 TEST (std::has_trivial_default_constructor,
struct_t,
true);
748 TEST (std::has_trivial_default_constructor,
const struct_t,
true);
749 TEST (std::has_trivial_default_constructor,
volatile struct_t,
true);
750 TEST (std::has_trivial_default_constructor,
struct_t [2],
true);
753 "portions of test_has_trivial_constructor() have been "
754 "disabled due to lack of compiler support.");
757#if defined (_RWSTD_TT_HAS_TRIVIAL_CTOR)
762 "portions of test_has_trivial_constructor() have been "
763 "disabled due to lack of compiler support.");
770static void test_has_trivial_copy ()
772 TEST (std::has_trivial_copy_constructor,
long,
true);
773 TEST (std::has_trivial_copy_constructor,
const long,
true);
774 TEST (std::has_trivial_copy_constructor,
volatile long,
true);
775 TEST (std::has_trivial_copy_constructor,
long&,
true);
776 TEST (std::has_trivial_copy_constructor,
long [2],
false);
778#if defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
779 || defined (_RWSTD_TT_IS_POD)
780 TEST (std::has_trivial_copy_constructor,
struct_t,
true);
781 TEST (std::has_trivial_copy_constructor,
const struct_t,
true);
782 TEST (std::has_trivial_copy_constructor,
volatile struct_t,
true);
785 "portions of test_has_trivial_copy() have been "
786 "disabled due to lack of compiler support.");
789 TEST (std::has_trivial_copy_constructor,
struct_t [2],
false);
791#if defined (_RWSTD_TT_HAS_TRIVIAL_COPY)
797 "portions of test_has_trivial_copy() have been "
798 "disabled due to lack of compiler support.");
805static void test_has_trivial_destructor ()
807 TEST (std::has_trivial_destructor,
long,
true);
808 TEST (std::has_trivial_destructor,
const long,
true);
809 TEST (std::has_trivial_destructor,
volatile long,
true);
810 TEST (std::has_trivial_destructor,
long&,
true);
811 TEST (std::has_trivial_destructor,
long [2],
true);
813#if defined (_RWSTD_TT_HAS_TRIVIAL_DTOR) \
814 || defined (_RWSTD_TT_IS_POD)
816 TEST (std::has_trivial_destructor,
const struct_t,
true);
817 TEST (std::has_trivial_destructor,
volatile struct_t,
true);
821 "portions of test_has_trivial_destructor() have been "
822 "disabled due to lack of compiler support.");
825#if defined (_RWSTD_TT_HAS_TRIVIAL_DTOR)
831 "portions of test_has_trivial_destructor() have been "
832 "disabled due to lack of compiler support.");
839static void test_has_nothrow_constructor ()
841 TEST (std::has_nothrow_default_constructor,
long,
true);
842 TEST (std::has_nothrow_default_constructor,
const long,
true);
843 TEST (std::has_nothrow_default_constructor,
volatile long,
true);
844 TEST (std::has_nothrow_default_constructor,
long&,
false);
845 TEST (std::has_nothrow_default_constructor,
long [2],
true);
847#if defined (_RWSTD_TT_HAS_NOTHROW_CTOR) \
848 || defined (_RWSTD_TT_HAS_TRIVIAL_CTOR) \
849 || defined (_RWSTD_TT_IS_POD)
850 TEST (std::has_nothrow_default_constructor,
struct_t,
true);
851 TEST (std::has_nothrow_default_constructor,
const struct_t,
true);
852 TEST (std::has_nothrow_default_constructor,
volatile struct_t,
true);
853 TEST (std::has_nothrow_default_constructor,
struct_t [2],
true);
856 "portions of test_has_nothrow_constructor() have been "
857 "disabled due to lack of compiler support.");
860#if defined (_RWSTD_TT_HAS_NOTHROW_CTOR)
864 TEST (std::has_nothrow_default_constructor,
struct_t,
true);
867 "portions of test_has_nothrow_constructor() have been "
868 "disabled due to lack of compiler support.");
874static void test_has_nothrow_copy ()
876 TEST (std::has_nothrow_copy_constructor,
long,
true);
877 TEST (std::has_nothrow_copy_constructor,
const long,
true);
878 TEST (std::has_nothrow_copy_constructor,
volatile long,
true);
879 TEST (std::has_nothrow_copy_constructor,
long&,
true);
880 TEST (std::has_nothrow_copy_constructor,
long [2],
false);
882#if defined (_RWSTD_TT_HAS_NOTHROW_COPY) \
883 || defined (_RWSTD_TT_HAS_TRIVIAL_COPY) \
884 || defined (_RWSTD_TT_IS_POD)
885 TEST (std::has_nothrow_copy_constructor,
struct_t,
true);
886 TEST (std::has_nothrow_copy_constructor,
const struct_t,
true);
887 TEST (std::has_nothrow_copy_constructor,
volatile struct_t,
true);
890 "portions of test_has_nothrow_copy() have been "
891 "disabled due to lack of compiler support.");
894 TEST (std::has_nothrow_copy_constructor,
struct_t [2],
false);
896#if defined (_RWSTD_TT_HAS_NOTHROW_COPY)
902 "portions of test_has_nothrow_copy() have been "
903 "disabled due to lack of compiler support.");
909static void test_has_virtual_destructor ()
917#if defined (_RWSTD_TT_HAS_VIRTUAL_DTOR) \
918 || defined (_RWSTD_TT_IS_CLASS) \
919 || defined (_RWSTD_TT_IS_UNION)
924 "portions of test_has_virtual_destructor() have been "
925 "disabled due to lack of compiler support.");
929static void test_is_signed ()
931 TEST (std::is_signed,
char,
char(-1) <
char(0));
933 TEST (std::is_signed,
signed char,
true);
934 TEST (std::is_signed,
signed short,
true);
935 TEST (std::is_signed,
signed int,
true);
936 TEST (std::is_signed,
signed long,
true);
938 TEST (std::is_signed,
unsigned char,
false);
939 TEST (std::is_signed,
unsigned short,
false);
940 TEST (std::is_signed,
unsigned int,
false);
941 TEST (std::is_signed,
unsigned long,
false);
943#ifndef _RWSTD_NO_LONG_LONG
944 TEST (std::is_signed,
signed long long,
true);
945 TEST (std::is_signed,
unsigned long long,
false);
948 TEST (std::is_signed,
float,
true);
949 TEST (std::is_signed,
double,
true);
951#ifndef _RWSTD_NO_LONG_DOUBLE
952 TEST (std::is_signed,
long double,
true);
960 TEST (std::is_signed,
long&,
false);
961 TEST (std::is_signed,
long*,
false);
962 TEST (std::is_signed,
long [2],
false);
963 TEST (std::is_signed,
long (),
false);
966static void test_is_unsigned ()
968 TEST (std::is_unsigned,
char,
char(0) <
char(-1));
970 TEST (std::is_unsigned,
signed char,
false);
971 TEST (std::is_unsigned,
signed short,
false);
972 TEST (std::is_unsigned,
signed int,
false);
973 TEST (std::is_unsigned,
signed long,
false);
975 TEST (std::is_unsigned,
unsigned char,
true);
976 TEST (std::is_unsigned,
unsigned short,
true);
977 TEST (std::is_unsigned,
unsigned int,
true);
978 TEST (std::is_unsigned,
unsigned long,
true);
980#ifndef _RWSTD_NO_LONG_LONG
981 TEST (std::is_unsigned,
signed long long,
false);
982 TEST (std::is_unsigned,
unsigned long long,
true);
985 TEST (std::is_unsigned,
float,
false);
986 TEST (std::is_unsigned,
double,
false);
988#ifndef _RWSTD_NO_LONG_DOUBLE
989 TEST (std::is_unsigned,
long double,
false);
997 TEST (std::is_unsigned,
unsigned long&,
false);
998 TEST (std::is_unsigned,
unsigned long*,
false);
999 TEST (std::is_unsigned,
unsigned long [2],
false);
1000 TEST (std::is_unsigned,
unsigned long (),
false);
1003static void test_alignment_of ()
1005#ifdef _RWSTD_NO_ALIGN_TRAITS
1008 "test_alignment_of() disabled because "
1009 "_RWSTD_NO_ALIGN_TRAITS is defined");
1014# define TEST(Trait,Type) \
1015 test_trait (__LINE__, #Trait, #Type, \
1016 Trait<Type>::value, _RWSTD_TT_ALIGN_OF(Type))
1018 TEST (std::alignment_of,
signed char);
1019 TEST (std::alignment_of,
signed short);
1020 TEST (std::alignment_of,
signed int);
1021 TEST (std::alignment_of,
signed long);
1023 TEST (std::alignment_of,
unsigned char);
1024 TEST (std::alignment_of,
unsigned short);
1025 TEST (std::alignment_of,
unsigned int);
1026 TEST (std::alignment_of,
unsigned long);
1028#ifndef _RWSTD_NO_LONG_LONG
1029 TEST (std::alignment_of,
signed long long);
1030 TEST (std::alignment_of,
unsigned long long);
1033 TEST (std::alignment_of,
float);
1034 TEST (std::alignment_of,
double);
1036#ifndef _RWSTD_NO_LONG_DOUBLE
1037 TEST (std::alignment_of,
long double);
1046 TEST (std::alignment_of,
void*);
1052static void test_rank ()
1055#define TEST(Trait, Type, Expect) \
1056 test_trait (__LINE__, #Trait, #Type, Trait<Type>::value, Expect)
1058 TEST (std::rank,
int, 0
ul);
1059 TEST (std::rank,
int [2], 1ul);
1060 TEST (std::rank,
int [][4], 2ul);
1061 TEST (std::rank,
int [4][4], 2ul);
1063 TEST (std::rank,
void, 0
ul);
1064 TEST (std::rank,
void*, 0
ul);
1069static void test_extent ()
1072#define TEST(Trait, Type, Depth, Expect) \
1073 test_trait (__LINE__, Depth, Trait<Type,Depth>::value, Expect, \
1076 TEST (std::extent,
int, 0, 0
ul);
1077 TEST (std::extent,
int [2], 0, 2ul);
1078 TEST (std::extent,
int [2][4], 0, 2ul);
1079 TEST (std::extent,
int [][4], 0, 0
ul);
1081 TEST (std::extent,
int, 1, 0
ul);
1082 TEST (std::extent,
int [2], 1, 0
ul);
1084 TEST (std::extent,
int [2][4], 0, 2ul);
1085 TEST (std::extent,
int [2][4], 1, 4ul);
1086 TEST (std::extent,
int [2][4], 2, 0
ul);
1088 TEST (std::extent,
int [][4], 0, 0
ul);
1089 TEST (std::extent,
int [][4], 1, 4ul);
1090 TEST (std::extent,
int [][4], 2, 0
ul);
1100 test_is_standard_layout ();
1103 test_is_polymorphic ();
1104 test_is_abstract ();
1105 test_has_trivial_constructor ();
1106 test_has_trivial_copy ();
1107 test_has_trivial_assign ();
1108 test_has_trivial_destructor ();
1109 test_has_nothrow_constructor ();
1110 test_has_nothrow_copy ();
1111 test_has_nothrow_assign ();
1112 test_has_virtual_destructor ();
1114 test_is_unsigned ();
1115 test_alignment_of ();
1131 "test disabled because _RWSTD_NO_EXT_CXX_0X is defined");
1141 return rw_test (argc, argv, __FILE__,
void run_test(const ForwardIterator &dummy, T *, Predicate *pred)
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_warn(int, const char *, int, const char *,...)
static access_controlled_t make(char, char)
no_trivial_assign_t & operator=(const no_trivial_assign_t &) _THROWS(())
no_trivial_copy_t(const no_trivial_copy_t &) _THROWS(())
no_trivial_ctor_t() _THROWS(())
throwing_assign_t & operator=(const throwing_assign_t &rhs)
throwing_copy_t(const throwing_copy_t &rhs)