#ifndef BOOST_QVM_SCALAR_TRAITS_HPP_INCLUDED #define BOOST_QVM_SCALAR_TRAITS_HPP_INCLUDED // Copyright 2008-2022 Emil Dotchevski and Reverge Studios, Inc. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include namespace boost { namespace qvm { template struct scalar_traits { static BOOST_QVM_CONSTEXPR BOOST_QVM_INLINE_CRITICAL Scalar value( int v ) { return Scalar(v); } }; namespace qvm_detail { template ::value, bool IsV=is_vec::value, bool IsM=is_mat::value, bool IsS=is_scalar::value> struct scalar_impl { typedef void type; }; template struct scalar_impl { typedef A type; }; template struct scalar_impl { typedef typename mat_traits::scalar_type type; }; template struct scalar_impl { typedef typename vec_traits::scalar_type type; }; template struct scalar_impl { typedef typename quat_traits::scalar_type type; }; } template struct scalar { typedef typename qvm_detail::scalar_impl::type type; }; } } #endif