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

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

#ifndef SCITBX_ARRAY_FAMILY_TINY_APPLY_H
#define SCITBX_ARRAY_FAMILY_TINY_APPLY_H

#ifndef DOXYGEN_SHOULD_SKIP_THIS

#include <scitbx/type_holder.h>
#include <scitbx/array_family/tiny.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<ReturnElementType, N>
  apply(UnaryOperation const& op,
        tiny<ElementType, N> const& a,
        type_holder<ReturnElementType> /*result_type_holder*/) {
    typedef tiny<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<typename UnaryOperation::result_type, N>
  apply(UnaryOperation const& op,
        tiny<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_APPLY_H
