[odb-users] Compile error when combining query::[member].in_range and query::_ref([var])

Jeroen N. Witmond [Bahco] jnw at xs4all.nl
Thu Feb 26 12:45:47 EST 2015


Greetings,

As far as I can see this has not yet been discussed on this mailing list.
While experimenting with ODB I ran into a problem in compiling a query
using in_range(), best described by the following code fragment:

#if 0
    // This does not compile.
    result r (db->query<FourPoint>
              (query::latitude.in_range(query::_ref(lat_min),
                                        query::_ref(lat_max)) &&
               query::longitude.in_range(query::_ref(lon_min),
                                         query::_ref(lon_max))));
#else
    // and this does.
    result r (db->query<FourPoint>
              (query::latitude > query::_ref(lat_min) &&
               query::latitude < query::_ref(lat_max) &&
               query::longitude > query::_ref(lon_min) &&
               query::longitude < query::_ref(lon_max)
              )
             );
#endif

The compiler I'm using is
  $ g++ -v
  Using built-in specs.
  COLLECT_GCC=g++
  COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
  Target: x86_64-linux-gnu
  Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5'
--with-bugurl=file:///usr/share/doc/gcc-4.7/README.
Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-bui
ld-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/
include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstd
cxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-che
cking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
  Thread model: posix
  gcc version 4.7.2 (Debian 4.7.2-5)

The messages it produces are beyond my comprehension.

Full source to demonstrate this problem is available on request.

Regards,

Jeroen.



More information about the odb-users mailing list