[Tile-serving] [osm2pgsql] Use std::vector for tags, members and nodes (#331)

Paul Norman notifications at github.com
Mon Apr 13 03:30:45 UTC 2015


Adding the file and building with clang++ 3.4 I get
```
depbase=`echo osmdata.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/sh ./libtool  --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I.  -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I/usr/include -I/usr/local/include -I/usr/local/include -DOSM2PGSQL_DATADIR='"/usr/local/share/osm2pgsql"' -Igeos-fallback -I/usr/local/include/lua52 -I/usr/local/include   -g -O2 -std=gnu++11 -MT osmdata.lo -MD -MP -MF $depbase.Tpo -c -o osmdata.lo osmdata.cpp &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -D_THREAD_SAFE -pthread -I/usr/local/include -I/usr/local/include/libxml2 -I/usr/include -I/usr/include -I/usr/local/include -I/usr/local/include -DOSM2PGSQL_DATADIR=\"/usr/local/share/osm2pgsql\" -Igeos-fallback -I/usr/local/include/lua52 -I/usr/local/include -g -O2 -std=gnu++11 -MT osmdata.lo -MD -MP -MF .deps/osmdata.Tpo -c osmdata.cpp  -fPIC -DPIC -o .libs/osmdata.o
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'boost::thread_detail::default_barrier_reseter' cannot bind to lvalue of type 'boost::thread_detail::default_barrier_reseter'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, boost::thread_detail::default_barrier_reseter &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1286:26: note: in instantiation of member function 'std::__1::__function::__func<boost::thread_detail::default_barrier_reseter, std::__1::allocator<boost::thread_detail::default_barrier_reseter>, unsigned long ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
/usr/local/include/boost/thread/barrier.hpp:108:55: note: in instantiation of function template specialization 'std::__1::function<unsigned long ()>::function<boost::thread_detail::default_barrier_reseter>' requested here
      m_count(check_counter(count)), m_generation(0), fct_(thread_detail::default_barrier_reseter(count))
                                                      ^
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<boost::thread_detail::default_barrier_reseter> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1294:34: note: in instantiation of member function 'std::__1::__function::__func<boost::thread_detail::default_barrier_reseter, std::__1::allocator<boost::thread_detail::default_barrier_reseter>, unsigned long ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
/usr/local/include/boost/thread/barrier.hpp:108:55: note: in instantiation of function template specialization 'std::__1::function<unsigned long ()>::function<boost::thread_detail::default_barrier_reseter>' requested here
      m_count(check_counter(count)), m_generation(0), fct_(thread_detail::default_barrier_reseter(count))
                                                      ^
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'boost::thread_detail::void_fct_ptr_barrier_reseter' cannot bind to lvalue of type 'boost::thread_detail::void_fct_ptr_barrier_reseter'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, boost::thread_detail::void_fct_ptr_barrier_reseter &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1286:26: note: in instantiation of member function 'std::__1::__function::__func<boost::thread_detail::void_fct_ptr_barrier_reseter, std::__1::allocator<boost::thread_detail::void_fct_ptr_barrier_reseter>, unsigned long ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
/usr/local/include/boost/thread/barrier.hpp:164:13: note: in instantiation of function template specialization 'std::__1::function<unsigned long ()>::function<boost::thread_detail::void_fct_ptr_barrier_reseter>' requested here
          ? thread_detail::size_completion_function(thread_detail::void_fct_ptr_barrier_reseter(count, funct))
            ^
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<boost::thread_detail::void_fct_ptr_barrier_reseter> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1294:34: note: in instantiation of member function 'std::__1::__function::__func<boost::thread_detail::void_fct_ptr_barrier_reseter, std::__1::allocator<boost::thread_detail::void_fct_ptr_barrier_reseter>, unsigned long ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
/usr/local/include/boost/thread/barrier.hpp:164:13: note: in instantiation of function template specialization 'std::__1::function<unsigned long ()>::function<boost::thread_detail::void_fct_ptr_barrier_reseter>' requested here
          ? thread_detail::size_completion_function(thread_detail::void_fct_ptr_barrier_reseter(count, funct))
            ^
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'unsigned int (*)()' cannot bind to lvalue of type 'unsigned int (*)()'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, unsigned int (*&&)(), false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1286:26: note: in instantiation of member function 'std::__1::__function::__func<unsigned int (*)(), std::__1::allocator<unsigned int (*)()>, unsigned long ()>::__func' requested here
            ::new (__f_) _FF(_VSTD::move(__f));
                         ^
/usr/local/include/boost/thread/barrier.hpp:172:13: note: in instantiation of function template specialization 'std::__1::function<unsigned long ()>::function<unsigned int (*)()>' requested here
          ? thread_detail::size_completion_function(funct)
            ^
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/tuple:320:11: error: rvalue reference to type 'allocator<[...]>' cannot bind to lvalue of type 'allocator<[...]>'
        : value(__t.get())
          ^     ~~~~~~~~~
/usr/include/c++/v1/tuple:444:8: note: in instantiation of member function 'std::__1::__tuple_leaf<0, std::__1::allocator<unsigned int (*)()> &&, false>::__tuple_leaf' requested here
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
       ^
/usr/include/c++/v1/functional:1294:34: note: in instantiation of member function 'std::__1::__function::__func<unsigned int (*)(), std::__1::allocator<unsigned int (*)()>, unsigned long ()>::__func' requested here
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
                                 ^
/usr/local/include/boost/thread/barrier.hpp:172:13: note: in instantiation of function template specialization 'std::__1::function<unsigned long ()>::function<unsigned int (*)()>' requested here
          ? thread_detail::size_completion_function(funct)
            ^
In file included from osmdata.cpp:1:
In file included from ./osmdata.hpp:8:
In file included from /usr/local/include/boost/shared_ptr.hpp:17:
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from /usr/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/v1/memory:603:
/usr/include/c++/v1/tuple:321:10: error: static_assert failed "Can not copy a tuple with rvalue reference member"
        {static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 errors generated.
Makefile:1185: recipe for target 'osmdata.lo' failed
gmake: *** [osmdata.lo] Error 1
```

This is something with C++11, as 8d803dc4d72f155dd89968916da12de297280c7f doesn't get that error.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/osm2pgsql/pull/331#issuecomment-92185526
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20150412/ae26b9b9/attachment-0001.html>


More information about the Tile-serving mailing list