SUNphi
1.0
|
Defines a class which assigns rhs SmET to lhs one. More...
#include <ios/Logger.hpp>
#include <smet/BinarySmET.hpp>
#include <smet/Reference.hpp>
#include <smet/ScalarWrap.hpp>
Go to the source code of this file.
Classes | |
struct | SUNphi::BaseAssigner |
struct | SUNphi::ConstrainAreAssigners< Args > |
class | SUNphi::Assigner< _Ref1, _Ref2, TK1, TK2 > |
Class to assign a SmET to another one. More... | |
Macros | |
#define | PROVIDE_SMET_ASSIGNEMENT_OPERATOR(UNARY_SMET) |
Defines the assignement operator, calling assign. More... | |
#define | PROVIDE_CONST_OR_NOT_DEFAULT_EVALUATOR(QUALIFIER) |
Provides either the const or non-const evaluator. More... | |
Typedefs | |
template<typename T , typename Ret = void> | |
using | SUNphi::EnableIfIsAssigner = EnableIf< isAssigner< T >,Ret > |
template<typename T > | |
using | SUNphi::ConstrainIsAssigner = ConstrainIsBaseOf< BaseAssigner,T > |
template<typename T > | |
using | SUNphi::ConstrainIsNotAssigner = ConstrainIsNotBaseOf< BaseAssigner,T > |
Functions | |
template<typename Lhs , typename Rhs > | |
void | SUNphi::assign (Lhs &&lhs, Rhs &&rhs, DummyTypes...) |
Variables | |
template<typename T > | |
constexpr bool | SUNphi::isAssigner = isBaseOf<BaseAssigner ,T> |
Defines a class which assigns rhs SmET to lhs one.
These are the steps:
A=B
, with A
being a SmET
, is intercepted. If A
is not assignable an exception is issued. This step is performed in each individual SmET
, because operator=
must be a static member function. The function assign(A,B)
is called.assign
where B
is not a SmET
are intercepted. If B
fundamental type is of a type that can be cast to the fundamental type of A, then we return A=scalar(B)
. Otherwise an exception is issued.A
, an exception is issued.assign
and using appropriate SFINAE
mechanism.assign
function is called, which returns the rhs as expected allowing to perform chain assignement on the expected return.Assigner
is created inside assign.Assigner
has mergeable components, they are merged.Definition in file Assign.hpp.
#define PROVIDE_CONST_OR_NOT_DEFAULT_EVALUATOR | ( | QUALIFIER | ) |
Provides either the const or non-const evaluator.
Definition at line 111 of file Assign.hpp.
#define PROVIDE_SMET_ASSIGNEMENT_OPERATOR | ( | UNARY_SMET | ) |
Defines the assignement operator, calling assign.
< Name of the NnarySmET
Definition at line 35 of file Assign.hpp.
using SUNphi::ConstrainIsAssigner = typedef ConstrainIsBaseOf<BaseAssigner ,T> |
Class forcing T to inherits from BaseAssigner
Definition at line 52 of file Assign.hpp.
using SUNphi::ConstrainIsNotAssigner = typedef ConstrainIsNotBaseOf<BaseAssigner ,T> |
Class forcing T not to inherits from BaseAssigner
Definition at line 52 of file Assign.hpp.
using SUNphi::EnableIfIsAssigner = typedef EnableIf< isAssigner <T> ,Ret> |
Provides the class itself if T is of the given type
Provides the class itself if T satisfies the condition
Definition at line 52 of file Assign.hpp.
void SUNphi::assign | ( | Lhs && | lhs, |
Rhs && | rhs, | ||
DummyTypes... | |||
) |
Default assigner taking only SmET
as left argument
Rhs
can be a SmET
or not, in which case it is wrapped into a Scalar
lhs | Left hand side, SmET to act upon |
rhs | Right hand side |
Definition at line 138 of file Assign.hpp.
constexpr bool SUNphi::isAssigner = isBaseOf<BaseAssigner ,T> |
Expression which is true if T inherits from BaseAssigner
Definition at line 52 of file Assign.hpp.