https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CastDualNumber.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
15template <typename T1, typename T2>
16inline typename std::enable_if<std::is_same<T1, T2>::value, T1>::type
17dual_number_cast(const T2 & v)
18{
19 return v;
20}
21
26template <typename T1, typename T2>
27inline typename std::enable_if<std::is_same<typename T2::value_type, T1>::value, T1>::type
28dual_number_cast(const T2 & v)
29{
30 return v.value();
31}
std::enable_if< std::is_same< T1, T2 >::value, T1 >::type dual_number_cast(const T2 &v)
no-op cast.