Changeset 3198


Ignore:
Timestamp:
Apr 29, 2014, 5:28:14 AM (7 years ago)
Author:
Peter
Message:

refs #790. Prefer checking (in configure) whether boost work rather
than relying on version comparisons. The result of the configure test
is stored in config_public.h which means an upgrade of boost is not
sufficient to avoid the workaround, the user also need to re-configure
yat (and install). That in turn means conditionals in header files are
identical to the ones used when building libyat and any potential
problems when conditionals are drifting away, changing declarations,
and causing mysterious link errors are avoided.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r3188 r3198  
    315315  [AC_MSG_RESULT([yes])])
    316316
     317# Check if boost::iterator_facade::operator-> works with a proxy class
     318# as reference_type; otherwise workaround is needed in
     319# e.g. BamPairIterator. See ticket #790.
     320AC_MSG_CHECKING([if boost::iterator_facade::operator-> works])
     321AC_COMPILE_IFELSE(
     322  [AC_LANG_PROGRAM(
     323    [@%:@include <iterator>
     324     @%:@include <boost/iterator/iterator_facade.hpp>
     325     struct MyClass { void foo(void) const { } };
     326     struct MyProxy { void foo(void) const { } };
     327     // a nonsense class (only for compiler test purposes)
     328     class MyIterator
     329       : public boost::iterator_facade<
     330        MyIterator, const MyClass, std::input_iterator_tag, MyProxy
     331       >
     332     {
     333       friend class boost::iterator_core_access;
     334       const MyProxy dereference(void) const { return MyProxy(); }
     335       bool equal(const MyIterator& other) const { return true; }
     336       void increment(void) {}
     337     };
     338    ],
     339    [MyIterator iter; iter->foo();]
     340    )
     341  ],[
     342    AC_MSG_RESULT([yes])
     343    AC_DEFINE([YAT_HAVE_BOOST_ITERATOR_FACADE_PROXY_PTR], [1],
     344              [Define to 1 if boost::iterator_facade::operator-> works])
     345  ],[
     346    AC_MSG_RESULT([no])
     347  ])
     348
    317349# samtools API from http://samtools.sourceforge.net
    318350AC_ARG_WITH([samtools],
  • trunk/yat/omic/BamPairIterator.h

    r3197 r3198  
    2323*/
    2424
    25 #include <iostream>
    26 
    2725#include "BamPair.h"
    2826#include "BamRead.h"
    2927
     28#include <yat/utility/config_public.h>
    3029#include <yat/utility/yat_assert.h>
    3130
     
    8786    explicit BamPairIterator(Base begin, Base end);
    8887
    89 #if BOOST_VERSION < 104900
     88#ifndef YAT_HAVE_BOOST_ITERATOR_FACADE_PROXY_PTR
    9089    /**
    9190       This is workaround implementation of operator-> when
  • trunk/yat/utility/config_public.h.in

    r3114 r3198  
    4646#undef YAT_HAVE_WORKING_BOOST_EXCEPTION_PTR
    4747
     48/// Define to 1 if boost::iterator_facade::operator-> works
     49#undef YAT_HAVE_BOOST_ITERATOR_FACADE_PROXY_PTR
     50
    4851/// Version of yat in string format
    4952#undef YAT_VERSION
Note: See TracChangeset for help on using the changeset viewer.