Bond
Loading...
Searching...
No Matches
odr.h
1
// Copyright (c) Microsoft. All rights reserved.
2
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4
#pragma once
5
6
#include <bond/core/config.h>
7
8
#include <boost/assert.hpp>
9
10
namespace
bond
11
{
12
13
namespace
detail
14
{
15
16
template
<
typename
T>
17
struct
counter
18
{
19
counter()
20
{
21
// This assert indicates violation of One Definition Rule for T.
22
BOOST_ASSERT(!value++);
23
}
24
25
static
int
value;
26
};
27
28
29
template
<
typename
T>
30
int
counter<T>::value;
31
32
}
33
34
35
template
<
typename
One,
typename
Variant>
36
struct
one_definition
37
{
38
static
detail::counter<One> value;
39
};
40
41
42
template
<
typename
One,
typename
Variant>
43
detail::counter<One> one_definition<One, Variant>::value;
44
45
46
}
bond
namespace bond
Definition:
apply.h:17
cpp
inc
bond
core
detail
odr.h
Generated by
1.9.5