本文整理汇总了C++中default_ops类的典型用法代码示例。如果您正苦于以下问题:C++ default_ops类的具体用法?C++ default_ops怎么用?C++ default_ops使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了default_ops类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: eval_bit_flip
inline void eval_bit_flip(const logged_adaptor<Backend>& arg, unsigned a)
{
using default_ops::eval_bit_flip;
log_prefix_event(arg.value(), a, "bit-flip");
eval_bit_flip(arg.value(), a);
log_postfix_event(arg.value(), arg, "bit-flip");
}
开发者ID:PAV38,项目名称:PDAL,代码行数:7,代码来源:logged_adaptor.hpp
示例2: eval_right_shift
inline void eval_right_shift(logged_adaptor<Backend>& arg, const logged_adaptor<Backend>& a, unsigned b)
{
using default_ops::eval_right_shift;
log_prefix_event(arg.value(), a, b, ">>");
eval_right_shift(arg.value(), a.value(), b);
log_postfix_event(arg.value(), ">>");
}
开发者ID:PAV38,项目名称:PDAL,代码行数:7,代码来源:logged_adaptor.hpp
示例3:
BOOST_MP_FORCEINLINE typename enable_if_c<is_compatible_arithmetic_type<V, number<B, et_off> >::value && (number_category<B>::value == number_kind_integer), number<B, et_off> >::type
operator & (const V& a, number<B, et_off>&& b)
{
using default_ops::eval_bitwise_and;
eval_bitwise_and(b.backend(), number<B, et_off>::canonical_value(a));
return static_cast<number<B, et_off>&&>(b);
}
开发者ID:betajippity,项目名称:Nuparu,代码行数:7,代码来源:no_et_ops.hpp
示例4: eval_convert_to
inline void eval_convert_to(R* result, const logged_adaptor<Backend>& val)
{
using default_ops::eval_convert_to;
log_prefix_event(val.value(), "convert_to");
eval_convert_to(result, val.value());
log_postfix_event(val.value(), *result, "convert_to");
}
开发者ID:PAV38,项目名称:PDAL,代码行数:7,代码来源:logged_adaptor.hpp
示例5: eval_lsb
inline typename enable_if_c<!is_trivial_cpp_int<cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1> >::value, unsigned>::type
eval_lsb(const cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>& a)
{
using default_ops::eval_get_sign;
if(eval_get_sign(a) == 0)
{
BOOST_THROW_EXCEPTION(std::range_error("No bits were set in the operand."));
}
if(a.sign())
{
BOOST_THROW_EXCEPTION(std::range_error("Testing individual bits in negative values is not supported - results are undefined."));
}
//
// Find the index of the least significant limb that is non-zero:
//
unsigned index = 0;
while(!a.limbs()[index] && (index < a.size()))
++index;
//
// Find the index of the least significant bit within that limb:
//
unsigned result = boost::multiprecision::detail::find_lsb(a.limbs()[index]);
return result + index * cpp_int_backend<MinBits1, MaxBits1, SignType1, Checked1, Allocator1>::limb_bits;
}
开发者ID:Caraul,项目名称:airgit,代码行数:26,代码来源:misc.hpp
示例6:
BOOST_MP_FORCEINLINE typename enable_if<is_compatible_arithmetic_type<V, number<B, et_off> >, number<B, et_off> >::type
operator / (number<B, et_off>&& a, const V& b)
{
using default_ops::eval_divide;
eval_divide(a.backend(), number<B, et_off>::canonical_value(b));
return static_cast<number<B, et_off>&&>(a);
}
开发者ID:AsherBond,项目名称:PDAL,代码行数:7,代码来源:no_et_ops.hpp
示例7: BOOST_MP_MOVE
BOOST_MP_FORCEINLINE number<B, et_off> operator + (const number<B, et_off>& a, const number<B, et_off>& b)
{
number<B, et_off> result;
using default_ops::eval_add;
eval_add(result.backend(), a.backend(), b.backend());
return BOOST_MP_MOVE(result);
}
开发者ID:AsherBond,项目名称:PDAL,代码行数:7,代码来源:no_et_ops.hpp
示例8:
BOOST_MP_FORCEINLINE typename enable_if<is_integral<I>, number<B, et_off> >::type
operator >> (number<B, et_off>&& a, const I& b)
{
using default_ops::eval_right_shift;
eval_right_shift(a.backend(), b);
return static_cast<number<B, et_off>&&>(a);
}
开发者ID:AsKorysti,项目名称:anura,代码行数:7,代码来源:no_et_ops.hpp
示例9: eval_integer_modulus
inline unsigned eval_integer_modulus(const logged_adaptor<Backend>& arg, const T& a)
{
using default_ops::eval_integer_modulus;
log_prefix_event(arg.value(), a, "integer-modulus");
unsigned r = eval_integer_modulus(arg.value(), a);
log_postfix_event(arg.value(), r, "integer-modulus");
return r;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:8,代码来源:logged_adaptor.hpp
示例10: eval_bit_test
inline bool eval_bit_test(const logged_adaptor<Backend>& arg, unsigned a)
{
using default_ops::eval_bit_test;
log_prefix_event(arg.value(), a, "bit-test");
bool r = eval_bit_test(arg.value(), a);
log_postfix_event(arg.value(), r, "bit-test");
return r;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:8,代码来源:logged_adaptor.hpp
示例11: eval_fpclassify
inline int eval_fpclassify(const logged_adaptor<Backend>& arg)
{
using default_ops::eval_fpclassify;
log_prefix_event(arg.value(), "fpclassify");
int r = eval_fpclassify(arg.value());
log_postfix_event(arg.value(), r, "fpclassify");
return r;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:8,代码来源:logged_adaptor.hpp
示例12: eval_lsb
inline unsigned eval_lsb(const logged_adaptor<Backend>& arg)
{
using default_ops::eval_lsb;
log_prefix_event(arg.value(), "least-significant-bit");
unsigned r = eval_lsb(arg.value());
log_postfix_event(arg.value(), r, "least-significant-bit");
return r;
}
开发者ID:BackupTheBerlios,项目名称:airdc-svn,代码行数:8,代码来源:logged_adaptor.hpp
示例13: BOOST_MP_MOVE
BOOST_MP_FORCEINLINE typename enable_if<is_compatible_arithmetic_type<V, number<B, et_off> >, number<B, et_off> >::type
operator ^ (const number<B, et_off>& a, const V& b)
{
number<B, et_off> result;
using default_ops::eval_bitwise_xor;
eval_bitwise_xor(result.backend(), a.backend(), number<B, et_off>::canonical_value(b));
return BOOST_MP_MOVE(result);
}
开发者ID:AsKorysti,项目名称:anura,代码行数:8,代码来源:no_et_ops.hpp
示例14: generic_interconvert
void generic_interconvert(To& to, const From& from, const mpl::int_<number_kind_integer>& /*to_type*/, const mpl::int_<number_kind_integer>& /*from_type*/)
{
using default_ops::eval_get_sign;
using default_ops::eval_bitwise_and;
using default_ops::eval_convert_to;
using default_ops::eval_right_shift;
using default_ops::eval_left_shift;
using default_ops::eval_bitwise_or;
using default_ops::eval_is_zero;
// smallest unsigned type handled natively by "From" is likely to be it's limb_type:
typedef typename canonical<unsigned char, From>::type limb_type;
// get the corresponding type that we can assign to "To":
typedef typename canonical<limb_type, To>::type to_type;
From t(from);
bool is_neg = eval_get_sign(t) < 0;
if(is_neg)
t.negate();
// Pick off the first limb:
limb_type limb;
limb_type mask = static_cast<limb_type>(~static_cast<limb_type>(0));
From fl;
eval_bitwise_and(fl, t, mask);
eval_convert_to(&limb, fl);
to = static_cast<to_type>(limb);
eval_right_shift(t, std::numeric_limits<limb_type>::digits);
//
// Then keep picking off more limbs until "t" is zero:
//
To l;
unsigned shift = std::numeric_limits<limb_type>::digits;
while(!eval_is_zero(t))
{
eval_bitwise_and(fl, t, mask);
eval_convert_to(&limb, fl);
l = static_cast<to_type>(limb);
eval_right_shift(t, std::numeric_limits<limb_type>::digits);
eval_left_shift(l, shift);
eval_bitwise_or(to, l);
shift += std::numeric_limits<limb_type>::digits;
}
//
// Finish off by setting the sign:
//
if(is_neg)
to.negate();
}
开发者ID:1ack,项目名称:Impala,代码行数:46,代码来源:generic_interconvert.hpp
示例15: precision_guard
BOOST_MP_FORCEINLINE number<B, et_off> operator - (const number<B, et_off>& a, const number<B, et_off>& b)
{
detail::scoped_default_precision<multiprecision::number<B, et_off> > precision_guard(a, b);
number<B, et_off> result;
using default_ops::eval_subtract;
eval_subtract(result.backend(), a.backend(), b.backend());
return result;
}
开发者ID:betajippity,项目名称:Nuparu,代码行数:8,代码来源:no_et_ops.hpp
注:本文中的default_ops类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论