Use type_traits to test if copyable/assignable
Replace compile tests that check if types are copy constructible and copy assignable with normal tests that use type_traits (if available).
This commit is contained in:
@@ -36,6 +36,10 @@
|
||||
#include <sstream>
|
||||
#include <stdint.h>
|
||||
|
||||
#if FMT_USE_TYPE_TRAITS
|
||||
# include <type_traits>
|
||||
#endif
|
||||
|
||||
#include "gmock/gmock.h"
|
||||
|
||||
#include "format.h"
|
||||
@@ -124,6 +128,16 @@ class TestString {
|
||||
}
|
||||
};
|
||||
|
||||
#if FMT_USE_TYPE_TRAITS
|
||||
TEST(WriterTest, NotCopyConstructible) {
|
||||
EXPECT_FALSE(std::is_copy_constructible<BasicWriter<char> >::value);
|
||||
}
|
||||
|
||||
TEST(WriterTest, NotCopyAssignable) {
|
||||
EXPECT_FALSE(std::is_copy_assignable<BasicWriter<char> >::value);
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(WriterTest, Ctor) {
|
||||
MemoryWriter w;
|
||||
EXPECT_EQ(0u, w.size());
|
||||
|
||||
Reference in New Issue
Block a user