Warning, /include/Vc/vector is written in an unsupported language. File is not indexed.
0001 /*{{{
0002 Copyright © 2013 Matthias Kretz <kretz@kde.org>
0003
0004 Permission to use, copy, modify, and distribute this software
0005 and its documentation for any purpose and without fee is hereby
0006 granted, provided that the above copyright notice appear in all
0007 copies and that both that the copyright notice and this
0008 permission notice and warranty disclaimer appear in supporting
0009 documentation, and that the name of the author not be used in
0010 advertising or publicity pertaining to distribution of the
0011 software without specific, written prior permission.
0012
0013 The author disclaim all warranties with regard to this
0014 software, including all implied warranties of merchantability
0015 and fitness. In no event shall the author be liable for any
0016 special, indirect or consequential damages or any damages
0017 whatsoever resulting from loss of use, data or profits, whether
0018 in an action of contract, negligence or other tortious action,
0019 arising out of or in connection with the use or performance of
0020 this software.
0021
0022 }}}*/
0023
0024 #ifndef VC_VECTOR_
0025 #define VC_VECTOR_
0026
0027 #include "common/subscript.h"
0028 #include <vector>
0029
0030 namespace Vc_VERSIONED_NAMESPACE
0031 {
0032 /**
0033 * \ingroup Containers
0034 * \headerfile vector <Vc/vector>
0035 *
0036 * An adapted `std::vector` container with an additional subscript operator which
0037 * implements gather and scatter operations.
0038 *
0039 * The [std::vector](https://en.cppreference.com/w/cpp/container/vector) documentation applies.
0040 *
0041 * Example:
0042 * \code
0043 * struct Point {
0044 * float x, y;
0045 * };
0046 * Vc::vector<Point> data;
0047 * data.resize(100);
0048 * // initialize values in data
0049 * float_v::IndexType indexes = ...; // values between 0-99
0050 * float_v x = data[indexes][&Point::x];
0051 * float_v y = data[indexes][&Point::y];
0052 * \endcode
0053 */
0054 template <typename T, typename Allocator = std::allocator<T>>
0055 using vector = Common::AdaptSubscriptOperator<std::vector<T, Allocator>>;
0056
0057 namespace Traits
0058 {
0059 template <typename T, typename A>
0060 struct has_contiguous_storage_impl<Vc::vector<T, A>> : public std::true_type {};
0061 } // namespace Traits
0062
0063 } // namespace
0064
0065 #endif // VC_VECTOR_
0066 // vim: ft=cpp