Chris@102: // Copyright 2005 The Trustees of Indiana University. Chris@102: Chris@102: // Use, modification and distribution is subject to the Boost Software Chris@102: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@102: // http://www.boost.org/LICENSE_1_0.txt) Chris@102: Chris@102: // Authors: Douglas Gregor Chris@102: // Andrew Lumsdaine Chris@102: Chris@102: #ifndef BOOST_PARALLEL_BASIC_REDUCE_HPP Chris@102: #define BOOST_PARALLEL_BASIC_REDUCE_HPP Chris@102: Chris@102: namespace boost { namespace parallel { Chris@102: Chris@102: /** Reduction operation used to reconcile differences between local Chris@102: * and remote values for a particular key in a property map. The Chris@102: * type @c T is typically the @c value_type of the property Chris@102: * map. This basic reduction returns a default-constructed @c T as Chris@102: * the default value and always resolves to the remote value. Chris@102: */ Chris@102: template Chris@102: struct basic_reduce Chris@102: { Chris@102: BOOST_STATIC_CONSTANT(bool, non_default_resolver = false); Chris@102: Chris@102: /// Returns a default-constructed T object Chris@102: template Chris@102: T operator()(const Key&) const { return T(); } Chris@102: Chris@102: /// Returns the remote value Chris@102: template Chris@102: const T& operator()(const Key&, const T&, const T& remote) const Chris@102: { return remote; } Chris@102: }; Chris@102: Chris@102: } } // end namespace boost::parallel Chris@102: Chris@102: #endif // BOOST_PARALLEL_BASIC_REDUCE_HPP