Loading [MathJax]/extensions/tex2jax.js
NiHu
2.0
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
Functions
Typedefs
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
c
d
f
i
m
n
p
q
r
s
t
v
x
Typedefs
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
v
w
x
y
Enumerator
d
i
j
k
l
m
n
o
p
q
r
s
t
Files
File List
File Members
All
Functions
Macros
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
crtp_base.hpp
Go to the documentation of this file.
1
// This file is a part of NiHu, a C++ BEM template library.
2
//
3
// Copyright (C) 2012-2014 Peter Fiala <fiala@hit.bme.hu>
4
// Copyright (C) 2012-2014 Peter Rucz <rucz@hit.bme.hu>
5
//
6
// This program is free software: you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation, either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
15
//
16
// You should have received a copy of the GNU General Public License
17
// along with this program. If not, see <http://www.gnu.org/licenses/>.
18
25
#ifndef CRTP_BASE_HPP_INCLUDED
26
#define CRTP_BASE_HPP_INCLUDED
27
29
#define NIHU_CRTP_HELPERS \
30
Derived const &derived() const \
31
{ \
32
return static_cast<Derived const &>(*this); \
33
} \
34
Derived &derived() \
35
{ \
36
return static_cast<Derived &>(*this); \
37
}
38
44
template
<
class
T,
class
...Ignore>
45
struct
ignore
46
{
47
typedef
T type;
48
};
49
51
template
<
class
Derived,
class
Dummy>
52
typename
ignore<Derived, Dummy>::type
const
*
const_crtp_ptr
(
void
)
53
{
54
return
static_cast<
typename ignore<Derived, Dummy>::type const*
>
(
nullptr
);
55
}
56
57
#endif // CRTP_BASE_HPP_INCLUDED
58
ignore
Metafunction returning its first argument and ignoring all subsequent.
Definition:
crtp_base.hpp:45
const_crtp_ptr
ignore< Derived, Dummy >::type const * const_crtp_ptr(void)
crtp decltype helper function
Definition:
crtp_base.hpp:52
src
util
crtp_base.hpp
Generated on Tue Mar 18 2025 01:00:17 for NiHu by
1.8.18