soci icon indicating copy to clipboard operation
soci copied to clipboard

Compilation failure with std::vector<boost::tuple<int>>

Open olsonanl opened this issue 4 years ago • 0 comments

I'm trying to use vectors of tuples to retrieve data in SOCI; should this work? The following example does not compile. Msys2 install on windows; boost 1.74.0, SOCI 4.0.0, gcc 10.2.0.

Using either vector or tuple alone compiles properly. Should this work? Thanks.

#include <vector>
#include <soci/boost-tuple.h>
#include <soci/soci.h>
int main(int argc, char **argv)
{
    soci::session sql;

    std::vector<boost::tuple<int>> v;
    soci::statement st =
        (sql.prepare << "SELECT a from b", soci::into(v));
    return 0;
}

errors:

make bug
g++ -g  -fdiagnostics-color=never    -c -o bug.o bug.cc
In file included from C:/msys64/mingw32/include/soci/bind-values.h:5,
                 from C:/msys64/mingw32/include/soci/statement.h:11,
                 from C:/msys64/mingw32/include/soci/values.h:11,
                 from C:/msys64/mingw32/include/soci/boost-tuple.h:11,
                 from bug.cc:2:
C:/msys64/mingw32/include/soci/exchange-traits.h: In instantiation of 'struct soci::details::exchange_traits<boost::tuples::tuple<int> >':
C:/msys64/mingw32/include/soci/exchange-traits.h:131:54:   required from 'struct soci::details::exchange_traits<std::vector<boost::tuples::tuple<int> > >'
C:/msys64/mingw32/include/soci/bind-values.h:211:68:   required from 'void soci::details::into_type_vector::exchange_(const soci::details::into_container<T, void>&, ...) [with T = std::vector<boost::tuples::tuple<int> >]'
C:/msys64/mingw32/include/soci/bind-values.h:143:18:   required from 'void soci::details::into_type_vector::exchange(const soci::details::into_container<T, Indicator>&) [with T = std::vector<boost::tuples::tuple<int> >; Indicator = void]'
C:/msys64/mingw32/include/soci/ref-counted-prepare-info.h:48:22:   required from 'void soci::details::ref_counted_prepare_info::exchange(const soci::details::into_container<T, Indicator>&) [with T = std::vector<boost::tuples::tuple<int> >; Indicator = void]'
C:/msys64/mingw32/include/soci/prepare-temp-type.h:44:24:   required from 'soci::details::prepare_temp_type& soci::details::prepare_temp_type::operator,(const soci::details::into_container<T, Indicator>&) [with T = std::vector<boost::tuples::tuple<int> >; Indicator = void]'
bug.cc:12:49:   required from here
C:/msys64/mingw32/include/soci/exchange-traits.h:41:16: error: incomplete type 'soci::details::exchange_traits<boost::tuples::tuple<int> >' used in nested name specifier
   41 |             >::x_type
      |                ^~~~~~
make: *** [<builtin>: bug.o] Error 1

olsonanl avatar Nov 22 '20 05:11 olsonanl