1
0
mirror of https://github.com/slendidev/smath.git synced 2026-03-17 02:26:50 +02:00

Add interop API

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2026-03-11 23:26:37 +02:00
parent c4109f0ce3
commit 01538457a5
2 changed files with 118 additions and 0 deletions

View File

@@ -1186,6 +1186,23 @@ template<typename T>
return m;
}
template<class Ext> struct interop_adapter;
template<class Ext>
constexpr auto from_external(Ext const &ext)
-> typename interop_adapter<Ext>::smath_type
{
return interop_adapter<Ext>::to_smath(ext);
}
template<class Ext, class SMathT>
constexpr auto to_external(SMathT const &value) -> Ext
{
return interop_adapter<Ext>::from_smath(value);
}
} // namespace smath
template<std::size_t N, typename T>