Hello,

I have a user defined type groups.

Following works.

groups g;
sql.once << "insert into groups(group_name,group_id) 
values(:group_name,:group_id)",use(g);

However 
std::vector<groups> gvals;
sql.once << "insert into groups(group_name,group_id) 
values(:group_name,:group_id)",use(gvals);

produces the attached error.

What is the expected way of handling vector ORM mapped objects?
-- 
 Shridhar
...patience...
...found 1507 targets...
...updating 3 targets...
gcc.compile.c++ build/db/gcc-4.4.2/release/project_test.o
In file included from /usr/local/include/soci/into.h:13,
                 from /usr/local/include/soci/soci.h:21,
                 from db/include/field.h:9,
                 from db/include/schema.h:4,
                 from db/project_test.cpp:1:
/usr/local/include/soci/type-conversion.h: In function 
‘soci::details::use_type_ptr soci::details::do_use(T&, const std::string&, 
soci::details::user_type_tag) [with T = std::vector<cmsadmin::groups, 
std::allocator<cmsadmin::groups> >]’:
/usr/local/include/soci/use.h:26:   instantiated from 
‘soci::details::use_type_ptr soci::use(T&, const std::string&) [with T = 
std::vector<cmsadmin::groups, std::allocator<cmsadmin::groups> >]’
db/project_test.cpp:51:   instantiated from here
/usr/local/include/soci/type-conversion.h:268: error: no matching function for 
call to 
‘soci::details::type_ptr<soci::details::use_type_base>::type_ptr(soci::details::conversion_use_type<std::vector<cmsadmin::groups,
 std::allocator<cmsadmin::groups> > >*)’
/usr/local/include/soci/type-ptr.h:21: note: candidates are: 
soci::details::type_ptr<T>::type_ptr(T*) [with T = soci::details::use_type_base]
/usr/local/include/soci/type-ptr.h:19: note:                 
soci::details::type_ptr<soci::details::use_type_base>::type_ptr(const 
soci::details::type_ptr<soci::details::use_type_base>&)
/usr/local/include/soci/type-conversion.h: In constructor 
‘soci::details::conversion_use_type<std::vector<T, std::allocator<_CharT> > 
>::conversion_use_type(std::vector<T, std::allocator<_CharT> >&, const 
std::string&) [with T = cmsadmin::groups]’:
/usr/local/include/soci/type-conversion.h:268:   instantiated from 
‘soci::details::use_type_ptr soci::details::do_use(T&, const std::string&, 
soci::details::user_type_tag) [with T = std::vector<cmsadmin::groups, 
std::allocator<cmsadmin::groups> >]’
/usr/local/include/soci/use.h:26:   instantiated from 
‘soci::details::use_type_ptr soci::use(T&, const std::string&) [with T = 
std::vector<cmsadmin::groups, std::allocator<cmsadmin::groups> >]’
db/project_test.cpp:51:   instantiated from here
/usr/local/include/soci/type-conversion.h:208: error: no matching function for 
call to ‘soci::details::use_type<std::vector<soci::values, 
std::allocator<soci::values> > >::use_type(std::vector<soci::values, 
std::allocator<soci::values> >&, std::vector<soci::indicator, 
std::allocator<soci::indicator> >&, const std::basic_string<char, 
std::char_traits<char>, std::allocator<char> >&)’
/usr/local/include/soci/values-exchange.h:76: note: candidates are: 
soci::details::use_type<std::vector<soci::values, std::allocator<soci::values> 
> >::use_type()
/usr/local/include/soci/values-exchange.h:74: note:                 
soci::details::use_type<std::vector<soci::values, std::allocator<soci::values> 
> >::use_type(const soci::details::use_type<std::vector<soci::values, 
std::allocator<soci::values> > >&)

    "g++"  -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -fPIC  
-DNDEBUG  -I"/usr/local/include/ImageMagick" -I"/usr/local/include/opencv" 
-I"/usr/local/include/soci" -I"db/include" -c -o 
"build/db/gcc-4.4.2/release/project_test.o" "db/project_test.cpp"

...failed gcc.compile.c++ build/db/gcc-4.4.2/release/project_test.o...
...skipped <pbuild/db/gcc-4.4.2/release>project_test for lack of 
<pbuild/db/gcc-4.4.2/release>project_test.o...
...skipped <pbuild/db/gcc-4.4.2/release>project_test.passed for lack of 
<pbuild/db/gcc-4.4.2/release>project_test...
...failed updating 1 target...
...skipped 2 targets...
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to