Commit 16b8be1f authored by COULAUD Olivier's avatar COULAUD Olivier

Fux bug with clang-5.0 still some compilation errors occur and some tests are failed

parent 7610d859
...@@ -132,18 +132,20 @@ public: ...@@ -132,18 +132,20 @@ public:
position, args...); position, args...);
} }
template<typename Position, typename... Args, std::size_t... Is, std::size_t... Js, typename... Ts> template<typename Position, typename... Args, std::size_t... Is,
void push_impl(inria::index_sequence<Is...>, std::size_t... Js, typename... Ts >
inria::index_sequence<Js...>, void push_impl(inria::index_sequence<Is...>,
const Position& position, inria::index_sequence<Js...>,
Args... args) { const Position& position,
using vt = typename FBase::value_type; Args... args)
constexpr auto Dim = Particle::position_t::Dim; {
constexpr int missing_offset = Dim + sizeof...(args); using vt = typename FBase::value_type;
constexpr auto Dim = Particle::position_t::Dim;
this->push_back(std::get<Is>(position)..., args..., constexpr int missing_offset = Dim + sizeof...(args);
std::tuple_element_t<missing_offset + Js, vt>{}...);
} this->push_back(std::get<Is>(position)..., args...,
std::tuple_element_t<missing_offset + Js, vt>{}...);
}
/** /**
* \brief Get size to send the container * \brief Get size to send the container
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <stdexcept> #include <stdexcept>
#include <tuple> #include <tuple>
#include <type_traits> #include <type_traits>
#include <utility>
#include "FOstreamTuple.hpp" #include "FOstreamTuple.hpp"
...@@ -191,7 +192,7 @@ public: ...@@ -191,7 +192,7 @@ public:
this->assign(first, last); this->assign(first, last);
} }
variadic_vector_impl(const variadic_vector_impl& other) { variadic_vector_impl( variadic_vector_impl& other) {
this->assign(other.begin(), other.end()); this->assign(other.begin(), other.end());
} }
...@@ -924,7 +925,7 @@ private: ...@@ -924,7 +925,7 @@ private:
*/ */
template <typename... Values> template <typename... Values>
iterator insert_impl( iterator insert_impl(
const_iterator pos, iterator pos,
size_type count, size_type count,
Values&&... values) Values&&... values)
{ {
...@@ -956,7 +957,7 @@ public: ...@@ -956,7 +957,7 @@ public:
* \return An iterator pointing to the inserted element * \return An iterator pointing to the inserted element
*/ */
template <typename ValueTuple> template <typename ValueTuple>
iterator insert(const_iterator pos, ValueTuple&& values) { iterator insert(iterator pos, ValueTuple&& values) {
static_assert(std::tuple_size<std::decay_t<ValueTuple>>::value == sizeof...(Indices), static_assert(std::tuple_size<std::decay_t<ValueTuple>>::value == sizeof...(Indices),
"Given tuple does not have the right size"); "Given tuple does not have the right size");
return insert_impl(pos, 1, std::get<Indices>(std::forward<ValueTuple>(values))...); return insert_impl(pos, 1, std::get<Indices>(std::forward<ValueTuple>(values))...);
...@@ -973,7 +974,7 @@ public: ...@@ -973,7 +974,7 @@ public:
* \return An iterator pointing to the first inserted element * \return An iterator pointing to the first inserted element
*/ */
template <typename ValueTuple> template <typename ValueTuple>
iterator insert(const_iterator pos, size_type count, ValueTuple&& values) { iterator insert(iterator pos, size_type count, ValueTuple&& values) {
static_assert(std::tuple_size<std::decay_t<ValueTuple>>::value == sizeof...(Indices), static_assert(std::tuple_size<std::decay_t<ValueTuple>>::value == sizeof...(Indices),
"Given tuple does not have the right size"); "Given tuple does not have the right size");
return insert_impl(pos, count, std::get<Indices>(std::forward<ValueTuple>(values))...); return insert_impl(pos, count, std::get<Indices>(std::forward<ValueTuple>(values))...);
...@@ -1036,7 +1037,7 @@ public: ...@@ -1036,7 +1037,7 @@ public:
template<class TupleIterator, template<class TupleIterator,
typename std::enable_if<is_tuple_get_like<TupleIterator>::value, char>::type = 0 typename std::enable_if<is_tuple_get_like<TupleIterator>::value, char>::type = 0
> >
iterator insert(const_iterator pos, TupleIterator first, TupleIterator last) { iterator insert(iterator pos, TupleIterator first, TupleIterator last) {
size_type pos_idx = pos - this->begin(); size_type pos_idx = pos - this->begin();
size_type count = last - first; size_type count = last - first;
...@@ -1074,7 +1075,7 @@ public: ...@@ -1074,7 +1075,7 @@ public:
template<class ValueIterator, template<class ValueIterator,
typename std::enable_if<! is_tuple_get_like<ValueIterator>::value, char>::type = 0 typename std::enable_if<! is_tuple_get_like<ValueIterator>::value, char>::type = 0
> >
iterator insert(const_iterator pos, ValueIterator first, ValueIterator last) { iterator insert(iterator pos, ValueIterator first, ValueIterator last) {
auto ret_offset = pos - this->cbegin(); auto ret_offset = pos - this->cbegin();
while(first != last) { while(first != last) {
insert(pos, *first); insert(pos, *first);
...@@ -1183,7 +1184,7 @@ public: ...@@ -1183,7 +1184,7 @@ public:
* *
* \param values Values to insert into the sub-arrays * \param values Values to insert into the sub-arrays
*/ */
void push_back(const Types&... values) { void push_back(Types const&... values) {
this->insert_impl(this->end(), 1, values...); this->insert_impl(this->end(), 1, values...);
} }
...@@ -1291,25 +1292,26 @@ public: ...@@ -1291,25 +1292,26 @@ public:
template<typename... Types, std::size_t... Indices> template<typename... Types, std::size_t... Indices>
class variadic_vector_iterator<std::tuple<Types...>, inria::index_sequence<Indices...>> class variadic_vector_iterator<std::tuple<Types...>, inria::index_sequence<Indices...> >
: public std::tuple<Types*...> { : public std::tuple<Types*...> {
using base_t = std::tuple<Types*...>; using base_t = std::tuple<Types*...>;
using value_tuple = std::tuple<typename std::remove_const<Types>::type...>; using value_tuple = std::tuple<typename std::remove_const<Types>::type...>;
using const_value_tuple = std::tuple<const Types...>; using const_value_tuple = std::tuple<const Types...>;
public: public:
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
using value_type = std::tuple<Types...>; using value_type = std::tuple<Types...>;
using reference = std::tuple<Types&...>; using reference = std::tuple<Types&...>;
using pointer = void; using pointer = void;
using iterator_category = std::random_access_iterator_tag; using iterator_category = std::random_access_iterator_tag;
using base_seq = inria::index_sequence<Indices...> ;
using pointer_tuple = std::tuple<Types*...>; using pointer_tuple = std::tuple<Types*...>;
using typename base_t::tuple; using typename base_t::tuple;
variadic_vector_iterator(base_t tup_in) : base_t(tup_in){} variadic_vector_iterator(base_t tup_in) : base_t(tup_in){}
variadic_vector_iterator(base_t tup_in, base_seq t) : base_t(tup_in){}
/* /*
*/ */
// variadic_vector_iterator(base_t tup_in):(tup_in){} // variadic_vector_iterator(base_t tup_in):(tup_in){}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment