// Copyright (C) 2026 EDF
// All Rights Reserved
// This code is published under the GNU Lesser General Public License (GNU LGPL)
#pragma once

///  \brief Conversion to be overloaded if necessary
namespace StOpt
{

template<typename T, typename Enable = void>
struct ToDouble
{
    static double eval(const T& v)
    {
        return static_cast<double>(v);
    }
};

template<typename T>
inline double toDouble(const T& v)
{
    return ToDouble<std::decay_t<T>>::eval(v);
}

}
