diff --git a/extensions/iidm/src/BranchObservability.cpp b/extensions/iidm/src/BranchObservability.cpp index 37a26026..1855cf1f 100644 --- a/extensions/iidm/src/BranchObservability.cpp +++ b/extensions/iidm/src/BranchObservability.cpp @@ -34,35 +34,35 @@ const std::string& BranchObservability::getName() const { } stdcxx::CReference BranchObservability::getQualityP1() const { - return stdcxx::cref(m_qualityP1); + return stdcxx::cref(m_qualityP1); } stdcxx::Reference BranchObservability::getQualityP1() { - return stdcxx::ref(m_qualityP1); + return stdcxx::ref(m_qualityP1); } stdcxx::CReference BranchObservability::getQualityP2() const { - return stdcxx::cref(m_qualityP2); + return stdcxx::cref(m_qualityP2); } stdcxx::Reference BranchObservability::getQualityP2() { - return stdcxx::ref(m_qualityP2); + return stdcxx::ref(m_qualityP2); } stdcxx::CReference BranchObservability::getQualityQ1() const { - return stdcxx::cref(m_qualityQ1); + return stdcxx::cref(m_qualityQ1); } stdcxx::Reference BranchObservability::getQualityQ1() { - return stdcxx::ref(m_qualityQ1); + return stdcxx::ref(m_qualityQ1); } stdcxx::CReference BranchObservability::getQualityQ2() const { - return stdcxx::cref(m_qualityQ2); + return stdcxx::cref(m_qualityQ2); } stdcxx::Reference BranchObservability::getQualityQ2() { - return stdcxx::ref(m_qualityQ2); + return stdcxx::ref(m_qualityQ2); } const std::type_index& BranchObservability::getType() const { diff --git a/include/powsybl/stdcxx/reference.hpp b/include/powsybl/stdcxx/reference.hpp index ce81b0cf..dde1c370 100644 --- a/include/powsybl/stdcxx/reference.hpp +++ b/include/powsybl/stdcxx/reference.hpp @@ -108,8 +108,8 @@ CReference cref(const std::unique_ptr& pointer) { return static_cast(pointer) ? CReference(*pointer) : CReference(); } -template ::value>::type> -CReference cref(const stdcxx::optional& optional) { +template ::value && std::is_same::value>::type> +CReference cref(const stdcxx::optional& optional) { return static_cast(optional) ? CReference(*optional) : CReference(); } @@ -138,8 +138,8 @@ Reference ref(const std::unique_ptr& pointer) { return static_cast(pointer) ? Reference(*pointer) : Reference(); } -template ::value>::type> -Reference ref(stdcxx::optional& optional) { +template ::value && std::is_same::value>::type> +Reference ref(stdcxx::optional& optional) { return static_cast(optional) ? Reference(*optional) : Reference(); }