Merge pull request #3849 from maxGimeno/STL_Extension-Fix_dispatch-GF

STL_Extension: Fix Dispatch_output_iterator test
This commit is contained in:
Sebastien Loriot 2019-04-23 09:39:57 +02:00 committed by GitHub
commit 9fe935c59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View File

@ -43,6 +43,7 @@
#include <vector>
#include <map>
#include <utility>
namespace CGAL {
@ -1324,6 +1325,14 @@ struct Derivator<D, std::tuple<V1, V...>, std::tuple<O1, O...> >
} // internal
namespace tuple_internal {
template <typename ...Args, std::size_t ...Is>
auto to_tuple(std::tuple<Args...> &t, std::index_sequence<Is...>)
{
return std::tuple<Args&...>(std::get<Is>(t)...);
}
}//end namespace tuple_internal
// OutputIterator which accepts several types in *o++= and dispatches,
// wraps several other output iterators, and dispatches accordingly.
@ -1408,6 +1417,16 @@ public:
tuple_dispatch(t);
return *this;
}
operator std::tuple<O&...>()
{
return tuple_internal::to_tuple(*this, std::index_sequence_for<O...>{});
}
operator std::tuple<const O&...>()const
{
return tuple_internal::to_tuple(*this, std::index_sequence_for<O...>{});
}
};
template < typename... V, typename... O>
@ -1449,6 +1468,7 @@ public:
template <class T>
Self& operator=(const T&) { return *this; }
};

View File

@ -30,7 +30,7 @@ do
fi
done
cmake -DCGAL_HEADER_ONLY=FALSE -DCGAL_ENABLE_CHECK_HEADERS=TRUE -DDOXYGEN_EXECUTABLE="$DOX_PATH" -DCGAL_COPY_DEPENDENCIES=TRUE -DCMAKE_CXX_FLAGS="-std=c++11" ..
cmake -DCGAL_HEADER_ONLY=FALSE -DCGAL_ENABLE_CHECK_HEADERS=TRUE -DDOXYGEN_EXECUTABLE="$DOX_PATH" -DCGAL_COPY_DEPENDENCIES=TRUE -DCMAKE_CXX_FLAGS="-std=c++14" ..
if [ -n "$DO_CHECK_HEADERS" ]; then
make -j$(nproc --all) -k check_headers
fi