maths: explicitly inline small methods

Avoids multiply defined symbols when using more aggressive inlining
This commit is contained in:
Danny Robson 2016-04-27 15:57:05 +10:00
parent a803a13e80
commit 2434424488
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -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
>