/* *****************************************************
   THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT.
   *****************************************************

   Generated by:
     scitbx.source_generators.array_family.generate_apply
 */

#ifndef SCITBX_ARRAY_FAMILY_TINY_PLAIN_APPLY_H
#define SCITBX_ARRAY_FAMILY_TINY_PLAIN_APPLY_H

#ifndef DOXYGEN_SHOULD_SKIP_THIS

#include <scitbx/type_holder.h>
#include <scitbx/array_family/tiny_plain.h>
#include <scitbx/array_family/detail/generic_array_operators.h>

namespace scitbx { namespace af {

  template<
    typename UnaryOperation, typename ElementType,
    std::size_t N, typename ReturnElementType>
  inline
  tiny_plain<ReturnElementType, N>
  apply(UnaryOperation const& op,
        tiny_plain<ElementType, N> const& a,
        type_holder<ReturnElementType> /*result_type_holder*/) {
    typedef tiny_plain<ReturnElementType, N> return_array_type;
    return_array_type result;
    array_operation_a(op,
      a.begin(), result.begin(), a.size(), true_type());
    return result;
  }

  template<typename UnaryOperation, typename ElementType, std::size_t N>
  inline
  tiny_plain<typename UnaryOperation::result_type, N>
  apply(UnaryOperation const& op,
        tiny_plain<ElementType, N> const& a) {
    return apply(op, a, type_holder<typename UnaryOperation::result_type>());
  }

}} // namespace scitbx::af

#endif // DOXYGEN_SHOULD_SKIP_THIS

#endif // SCITBX_ARRAY_FAMILY_TINY_PLAIN_APPLY_H
