CASM
1.1.0
A Clusters Approach to Statistical Mechanics
CRTPBase.hh
Go to the documentation of this file.
1
#ifndef CASM_CRTPBase
2
#define CASM_CRTPBase
3
4
namespace
notstd
{
5
7
template
<
typename
_MostDerived>
8
class
CRTPBase
{
9
public
:
10
typedef
_MostDerived
MostDerived
;
11
12
protected
:
13
MostDerived
&
derived
() {
return
*
static_cast<
MostDerived
*
>
(
this
); }
14
15
const
MostDerived
&
derived
()
const
{
16
return
*
static_cast<
const
MostDerived
*
>
(
this
);
17
}
18
};
19
}
// namespace notstd
20
21
namespace
CASM
{
22
23
template
<
typename
MostDerived>
24
using
CRTPBase
=
notstd::CRTPBase<MostDerived>
;
25
26
namespace
CASM_TMP {
27
template
<
typename
MostDerived>
28
using
CRTPBase
=
notstd::CRTPBase<MostDerived>
;
29
}
30
}
// namespace CASM
31
32
#endif
notstd::CRTPBase
Base class for CRTP pattern.
Definition:
CRTPBase.hh:8
notstd::CRTPBase::derived
MostDerived & derived()
Definition:
CRTPBase.hh:13
notstd::CRTPBase::MostDerived
_MostDerived MostDerived
Definition:
CRTPBase.hh:10
notstd::CRTPBase::derived
const MostDerived & derived() const
Definition:
CRTPBase.hh:15
CASM
Main CASM namespace.
Definition:
APICommand.hh:8
notstd
Non-std smart pointer classes and functions.
Definition:
cloneable_ptr.hh:79
include
casm
misc
CRTPBase.hh
Generated on Tue Mar 23 2021 14:16:40 for CASM by
1.9.1