MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / type assign

Method type assign

extern/boost/boost/rational.hpp:263–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261
262 template <class T, class U>
263 BOOST_CXX14_CONSTEXPR typename enable_if_c<
264 (!rational_detail::is_compatible_integer<T, IntType>::value
265 || !rational_detail::is_compatible_integer<U, IntType>::value)
266 && std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer
267 && (std::numeric_limits<T>::radix == std::numeric_limits<IntType>::radix)
268 && is_convertible<T, IntType>::value &&
269 std::numeric_limits<U>::is_specialized && std::numeric_limits<U>::is_integer
270 && (std::numeric_limits<U>::radix == std::numeric_limits<IntType>::radix)
271 && is_convertible<U, IntType>::value,
272 rational &
273 >::type assign(const T& n, const U& d)
274 {
275 if(!is_safe_narrowing_conversion(n) || !is_safe_narrowing_conversion(d))
276 BOOST_THROW_EXCEPTION(bad_rational());
277 return *this = rational<IntType>(static_cast<IntType>(n), static_cast<IntType>(d));
278 }
279
280 // Access to representation
281 BOOST_CONSTEXPR

Callers

nothing calls this directly

Calls 1

bad_rationalClass · 0.85

Tested by

no test coverage detected