Boost C++ 库

...世界上最受推崇和设计精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu,《C++ 编码规范

结构模板 is_commutative - Boost C++ 函数库
PrevUpHomeNext

结构模板 is_commutative

boost::mpi::is_commutative — 确定一个函数对象类型是否具有交换律。

提要

// In header: <boost/mpi/operations.hpp>

template<typename Op, typename T> 
struct is_commutative : public mpl::false_ {
};

描述

这个特性用于确定当应用于类型为 T 的值时,操作 Op 是否具有交换律。 诸如 reduceprefix_sum 等并行操作,使用具有交换律的操作可以更有效地实现。 为了将操作标记为具有交换律,用户应该专门化 is_commutative 并继承自类 mpl::true_


PrevUpHomeNext