summaryrefslogtreecommitdiff
path: root/lib/dbTypes.cpp
blob: 56e7a861e048bdf78cb3debd79b4fc5af3efe807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "dbTypes.h"
#include <iostream> // Required else this write::operator() is always recursive

namespace std {
	struct write {
		template<typename T>
		std::ostream &
		operator()(const T & v) const
		{
			return strm << v;
		}
		std::ostream & strm;
	};

	std::ostream &
	operator<<(std::ostream & strm, const MyGrate::DbValueV & v)
	{
		return std::visit(write {strm}, v);
	}
}

static_assert(std::is_copy_assignable_v<MyGrate::Date>);
static_assert(std::is_copy_assignable_v<MyGrate::Time>);
static_assert(std::is_copy_assignable_v<MyGrate::DateTime>);
static_assert(std::is_copy_assignable_v<MyGrate::Blob>);
static_assert(std::is_copy_assignable_v<timespec>);
static_assert(std::is_copy_assignable_v<MyGrate::BitSet>);
static_assert(std::is_copy_assignable_v<MyGrate::DbValueV>);
static_assert(std::is_copy_assignable_v<MyGrate::DbValue>);

static_assert(std::is_move_assignable_v<MyGrate::Date>);
static_assert(std::is_move_assignable_v<MyGrate::Time>);
static_assert(std::is_move_assignable_v<MyGrate::DateTime>);
static_assert(std::is_move_assignable_v<MyGrate::Blob>);
static_assert(std::is_move_assignable_v<timespec>);
static_assert(std::is_move_assignable_v<MyGrate::BitSet>);
static_assert(std::is_move_assignable_v<MyGrate::DbValueV>);
static_assert(std::is_move_assignable_v<MyGrate::DbValue>);