This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Explicit instantiation failing in 3.5 (boost)
- From: larsbj at gullik dot net (Lars Gullik Bjønnes)
- To: libstdc++ at gcc dot gnu dot org
- Date: Sat, 31 Jul 2004 04:03:07 +0200
- Subject: Explicit instantiation failing in 3.5 (boost)
- Organization: LyX Developer http://www.lyx.org/
This is adapted from code in connection.hpp in boost.
Should it work or is the code in fact wrong, and makes assumptions
that the standard does not provide?
------
#include <list>
struct bound_object {
bool operator==(const bound_object& other) const;
bool operator<(const bound_object& other) const;
};
template class std::list<bound_object>;
--------
g++ (GCC) 3.5.0 20040731 (experimental)
g++ -c -o alloc.o alloc.C
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_list.h: In member function `std::_List_node<_Tp>* std::list<_Tp, _Alloc>::_M_create_node() [with _Tp = bound_object, _Alloc = std::allocator<bound_object>]':
alloc.C:8: instantiated from here
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/bits/stl_list.h:460: error: no matching function for call to `std::allocator<bound_object>::construct(bound_object*)'
/opt/gcc-head/lib/gcc/i686-pc-linux-gnu/3.5.0/../../../../include/c++/3.5.0/ext/mt_allocator.h:106: note: candidates are: void __gnu_cxx::__mt_alloc<_Tp>::construct(_Tp*, const _Tp&) [with _Tp = bound_object]
--
Lgb