Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
BilinearWeakExpression.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_BilinearWeakExpression_H_
9#define model_BilinearWeakExpression_H_
10
11namespace model
12{
13
14 template <typename Derived>
16 {
17
18 Derived& derived()
19 {
20 return *static_cast<Derived*>(this);
21 }
22
23 Derived* p_derived()
24 {
25 return static_cast<Derived*>(this);
26 }
27
28 const Derived& derived() const
29 {
30 return *static_cast<const Derived*>(this);
31 }
32
33 const Derived* p_derived() const
34 {
35 return static_cast<const Derived*>(this);
36 }
37
38 operator const Derived&() const
39 {
40 return derived();
41 }
42
43 };
44
45}
46#endif