23#ifndef G2O_CERES_PUBLIC_INTERNAL_MEMORY_H_
24#define G2O_CERES_PUBLIC_INTERNAL_MEMORY_H_
28#ifdef G2O_CERES_HAVE_EXCEPTIONS
29#define G2O_CERES_INTERNAL_TRY try
30#define G2O_CERES_INTERNAL_CATCH_ANY catch (...)
31#define G2O_CERES_INTERNAL_RETHROW \
36#define G2O_CERES_INTERNAL_TRY if (true)
37#define G2O_CERES_INTERNAL_CATCH_ANY else if (false)
38#define G2O_CERES_INTERNAL_RETHROW \
47template <
typename Allocator,
typename Iterator,
typename... Args>
49 const Args&... args) {
50 for (Iterator cur = first; cur != last; ++cur) {
52 std::allocator_traits<Allocator>::construct(alloc, std::addressof(*cur),
56 while (cur != first) {
58 std::allocator_traits<Allocator>::destroy(alloc, std::addressof(*cur));
65template <
typename Allocator,
typename Iterator,
typename InputIterator>
66void CopyRange(Allocator& alloc, Iterator destination, InputIterator first,
68 for (Iterator cur = destination; first != last;
69 static_cast<void>(++cur),
static_cast<void>(++first)) {
71 std::allocator_traits<Allocator>::construct(alloc, std::addressof(*cur),
75 while (cur != destination) {
77 std::allocator_traits<Allocator>::destroy(alloc, std::addressof(*cur));
#define G2O_CERES_INTERNAL_RETHROW
#define G2O_CERES_INTERNAL_TRY
#define G2O_CERES_INTERNAL_CATCH_ANY
void CopyRange(Allocator &alloc, Iterator destination, InputIterator first, InputIterator last)
void ConstructRange(Allocator &alloc, Iterator first, Iterator last, const Args &... args)