maths: explicitly inline small methods
Avoids multiply defined symbols when using more aggressive inlining
This commit is contained in:
parent
a803a13e80
commit
2434424488
@ -11,7 +11,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Copyright 2011 Danny Robson <danny@nerdcruft.net>
|
||||
* Copyright 2011-2016 Danny Robson <danny@nerdcruft.net>
|
||||
*/
|
||||
|
||||
#ifndef __FLOAT_HPP
|
||||
@ -81,5 +81,4 @@ static_assert (sizeof(ieee_half ) == 2, "ieee_half must be 2 bytes");
|
||||
static_assert (sizeof(ieee_single ) == 4, "ieee_single must be 4 bytes");
|
||||
static_assert (sizeof(ieee_double ) == 8, "ieee_double must be 8 bytes");
|
||||
|
||||
|
||||
#endif // __FLOAT_HPP
|
||||
|
@ -57,6 +57,7 @@ namespace util {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename A, typename B>
|
||||
inline
|
||||
typename std::enable_if_t<
|
||||
std::is_floating_point<A>::value &&
|
||||
std::is_floating_point<B>::value,
|
||||
@ -72,6 +73,7 @@ namespace util {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename A, typename B>
|
||||
inline
|
||||
typename std::enable_if_t<
|
||||
std::is_integral<A>::value &&
|
||||
std::is_integral<B>::value &&
|
||||
@ -86,6 +88,7 @@ namespace util {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename Ta, typename Tb>
|
||||
inline
|
||||
typename std::enable_if<
|
||||
!std::is_arithmetic<Ta>::value ||
|
||||
!std::is_arithmetic<Tb>::value,
|
||||
@ -113,6 +116,7 @@ namespace util {
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
template <typename Ta, typename Tb>
|
||||
inline
|
||||
typename std::enable_if_t<
|
||||
!std::is_arithmetic<Ta>::value ||
|
||||
!std::is_arithmetic<Tb>::value,
|
||||
@ -157,6 +161,7 @@ namespace util {
|
||||
|
||||
|
||||
template <typename T>
|
||||
constexpr
|
||||
typename std::enable_if_t<
|
||||
!std::is_integral<T>::value, bool
|
||||
>
|
||||
|
Loading…
Reference in New Issue
Block a user