On 21/10/10 15:39, Henning Basold wrote:
> Am 21.10.2010 12:46, schrieb Mateusz Loskot:
>> Yesterday, I tried to compile it and add some tests, but GCC 4.4 
>> reported some compilation errors.
>> It was late night, so I didn't try to investigate it.
>> I will continue tonight.
>
> Mh, that's strange. I compiled it here with GCC 4.4.3 and at work with 
> MSVC 2008. Did you compile the tests or something else?


The problem is not with compiler, but it seems to be with Boost version.
Simply, boost::tuple is not (yet?) recognised as a fusion sequence, thus
enabling the specialisations for the fusion, causes problems with
boost::tuple support in SOCI.
As far as I know, boost::tuple is not adapted as a regular fusion sequence.


Two simple examples compiled using
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

1) First example

#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/container.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
using namespace boost;
int main()
{
BOOST_MPL_ASSERT(( fusion::traits::is_sequence<fusion::vector<int> > ));
BOOST_MPL_ASSERT(( fusion::traits::is_sequence<boost::tuple<int> > ));
}

a) does not compile with Boost 1.42

///BOF//////////////////////////////////////////////////////////////////
mlos...@dog:~/workshop/boost/fusion$ g++ -Wall -pedantic -I/usr/include
tuple_is_sequence.cpp
In file included from /usr/include/boost/fusion/support/is_sequence.hpp:12,
                 from tuple_is_sequence.cpp:1:
/usr/include/boost/fusion/support/tag_of.hpp: In instantiation of
‘boost::fusion::traits::tag_of<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type>, void>’:
/usr/include/boost/fusion/support/tag_of.hpp:107:   instantiated from
‘boost::fusion::detail::tag_of<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >’
/usr/include/boost/fusion/support/is_sequence.hpp:61:   instantiated
from ‘boost::fusion::traits::is_sequence<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >’
/usr/include/boost/mpl/assert.hpp:148:   instantiated from
‘mpl_::assert_arg_pred_not<boost::fusion::traits::is_sequence<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> > >’
tuple_is_sequence.cpp:11:   instantiated from here
/usr/include/boost/fusion/support/tag_of.hpp:92: error: no matching
function for call to ‘assertion_failed(mpl_::failed************
boost::mpl::not_<boost::fusion::detail::is_specialized<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> > >::************)’
tuple_is_sequence.cpp: In function ‘int main()’:
tuple_is_sequence.cpp:11: error: no matching function for call to
‘assertion_failed(mpl_::failed************
boost::fusion::traits::is_sequence<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >::************)’
mlos...@dog:~/workshop/boost/fusion$
///EOF//////////////////////////////////////////////////////////////////


b) it also does not compile with Boost trunk from current SVN,
but reporting a bit different error:

///BOF//////////////////////////////////////////////////////////////////
mlos...@dog:~/workshop/boost/fusion$ g++ -Wall -pedantic
-I/home/mloskot/dev/boost/_svn/trunk tuple_is_sequence.cpp
tuple_is_sequence.cpp: In function ‘int main()’:
tuple_is_sequence.cpp:11: error: no matching function for call to
‘assertion_failed(mpl_::failed************
boost::fusion::traits::is_sequence<boost::tuples::tuple<int,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> >::************)’
mlos...@dog:~/workshop/boost/fusion$
///EOF//////////////////////////////////////////////////////////////////


2) Second example:

#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/container.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/mpl/assert.hpp>
#include <iostream>
using namespace boost;
int main()
{
std::cout <<
  fusion::traits::is_sequence<fusion::vector<int> >::value << std::endl;
std::cout <<
  fusion::traits::is_sequence<boost::tuple<int> >::value << std::endl;
}

a) does not compile with Boost 1.42 - the same error as for 1) a)

b) does compile with Boost from SVN trunk, but does not identify tuple
as fusion sequence:

///BOF//////////////////////////////////////////////////////////////////
mlos...@dog:~/workshop/boost/fusion$ g++ -Wall -pedantic
-I/home/mloskot/dev/boost/_svn/trunk tuple_is_sequence.cpp

mlos...@dog:~/workshop/boost/fusion$ ./a.out
1
0
mlos...@dog:~/workshop/boost/fusion$
///EOF//////////////////////////////////////////////////////////////////


Back to your patch, compiling SOCI tests with your patch and Boost 1.42
gives nearly exactly the same error as in the case 1) a)

///BOF//////////////////////////////////////////////////////////////////
src/core/test/common-tests.h:3115:   instantiated from here
/usr/include/boost/fusion/support/tag_of.hpp:92: error: no matching
function for call to ‘assertion_failed(mpl_::failed************
boost::mpl::not_<boost::fusion::detail::is_specialized<boost::tuples::tuple<double,
int, std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type> > >::************)’
///EOF//////////////////////////////////////////////////////////////////

The line common-tests.h:3115 is the first test case using boost::tuple

http://soci.git.sourceforge.net/git/gitweb.cgi?p=soci/soci;a=blob;f=src/core/test/common-tests.h;h=e38d9151d7a3e57c0f8423dc83e0352297e71d93;hb=HEAD#l3115

Having your patch applied, the new fusion support templates interfere
with the tuples.

Which version of Boost do you use?
Have you tried compiling the tests?

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to