//          Copyright Carl Philipp Reh 2009 - 2021.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

#ifndef FCPPT_MATH_VECTOR_INIT_HPP_INCLUDED
#define FCPPT_MATH_VECTOR_INIT_HPP_INCLUDED

#include <fcppt/math/detail/init.hpp>
#include <fcppt/math/vector/is_vector.hpp>

namespace fcppt::math::vector
{
/**
\brief Initializes a vector

\ingroup fcpptmathvector

Calls <code>_function</code> for every index of the vector.

\tparam Vector Must be a vector

\tparam Function Must be a function of type <code>Vector::value_type
(Vector::size_type)</code>
*/
template <typename Vector, typename Function>
inline Vector init(Function const &_function)
  requires fcppt::math::vector::is_vector<Vector>::value
{
  return fcppt::math::detail::init<Vector>(_function);
}
}

#endif
