GQCP
Loading...
Searching...
No Matches
CRTP.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
21namespace GQCP {
22
23
31template <typename _Derived>
32class CRTP {
33public:
34 // The type of the derived class.
35 using Derived = _Derived;
36
37
38public:
39 /*
40 * MARK: Derived-casts
41 */
42
46 Derived& derived() { return static_cast<Derived&>(*this); }
47
51 const Derived& derived() const { return static_cast<const Derived&>(*this); }
52};
53
54
55} // namespace GQCP
Definition: CRTP.hpp:32
const Derived & derived() const
Definition: CRTP.hpp:51
_Derived Derived
Definition: CRTP.hpp:35
Derived & derived()
Definition: CRTP.hpp:46
Definition: BaseOneElectronIntegralBuffer.hpp:25