Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
LinearWeakExpression.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_LinearWeakExpression_H_
9#define model_LinearWeakExpression_H_
10
11
12
13
14namespace model
15{
16
17
18
19
20 /**************************************************************************/
21 /**************************************************************************/
22 template <typename Derived>
24 {
25 /**********************************************************************/
26 Derived& derived()
27 {
29 return *static_cast<Derived*>(this);
30 }
31
32 /**********************************************************************/
33 Derived* p_derived()
34 {
36 return static_cast<Derived*>(this);
37 }
38
39 /**********************************************************************/
40 const Derived& derived() const
41 {
43 return *static_cast<const Derived*>(this);
44 }
45
46 /**********************************************************************/
47 const Derived* p_derived() const
48 {
50 return static_cast<const Derived*>(this);
51 }
52
53 /**********************************************************************/
54 operator const Derived&() const
55 {
57 return derived();
58 }
59 };
60
61
62} // close namespace
63#endif
64
const Derived * p_derived() const
const Derived & derived() const