Loading...
Searching...
No Matches
literal.h
Go to the documentation of this file.
1#ifndef _BBM_LITERAL_H_
2#define _BBM_LITERAL_H_
3
4/************************************************************************/
5/*! \file literal.h
6
7 \brief Work around for using floating point literals for compilers that
8 do not support it (e.g., Clang 14).
9
10*************************************************************************/
11
12namespace bbm {
13
14 template<typename T=int>
15 struct literal
16 {
17 using type = T;
18
19 //! \brief Constructor
20 inline constexpr literal(T val=0) : value(val) {}
21
22 //! \brief Cast to T
23 inline constexpr operator T(void) const { return value; }
24
25 //! \brief data
27 };
28
29} // end bbm namespace
30
31#endif /* _BBM_LITERAL_H_ */
Definition: aggregatebsdf.h:29
Definition: literal.h:16
T value
data
Definition: literal.h:26
T type
Definition: literal.h:17
constexpr literal(T val=0)
Constructor.
Definition: literal.h:20