/*{{{
    Copyright © 2013 Matthias Kretz <kretz@kde.org>

    Permission to use, copy, modify, and distribute this software
    and its documentation for any purpose and without fee is hereby
    granted, provided that the above copyright notice appear in all
    copies and that both that the copyright notice and this
    permission notice and warranty disclaimer appear in supporting
    documentation, and that the name of the author not be used in
    advertising or publicity pertaining to distribution of the
    software without specific, written prior permission.

    The author disclaim all warranties with regard to this
    software, including all implied warranties of merchantability
    and fitness.  In no event shall the author be liable for any
    special, indirect or consequential damages or any damages
    whatsoever resulting from loss of use, data or profits, whether
    in an action of contract, negligence or other tortious action,
    arising out of or in connection with the use or performance of
    this software.

}}}*/

#ifndef VC_VECTOR_
#define VC_VECTOR_

#include "common/subscript.h"
#include <vector>

namespace Vc_VERSIONED_NAMESPACE
{
/**
 * \ingroup Containers
 * \headerfile vector <Vc/vector>
 *
 * An adapted `std::vector` container with an additional subscript operator which
 * implements gather and scatter operations.
 *
 * The [std::vector](https://en.cppreference.com/w/cpp/container/vector) documentation applies.
 *
 * Example:
 * \code
 * struct Point {
 *   float x, y;
 * };
 * Vc::vector<Point> data;
 * data.resize(100);
 * // initialize values in data
 * float_v::IndexType indexes = ...;  // values between 0-99
 * float_v x = data[indexes][&Point::x];
 * float_v y = data[indexes][&Point::y];
 * \endcode
 */
template <typename T, typename Allocator = std::allocator<T>>
using vector = Common::AdaptSubscriptOperator<std::vector<T, Allocator>>;

namespace Traits
{
template <typename T, typename A>
struct has_contiguous_storage_impl<Vc::vector<T, A>> : public std::true_type {};
}  // namespace Traits

}  // namespace

#endif  // VC_VECTOR_
// vim: ft=cpp
