Changeset 3197
- Timestamp:
- Apr 29, 2014, 3:40:53 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/bam_pair_iterator.cc
r3196 r3197 27 27 #include "yat/omic/BamWriteIterator.h" 28 28 #endif 29 30 #include <boost/version.hpp>31 29 32 30 #include <algorithm> … … 76 74 for (; piter!=pend; ++piter) { 77 75 result.push_back(*piter); 76 result.back() = *piter; 78 77 // This code doesn't work with boost 1.48 (or older). See 79 78 // https://svn.boost.org/trac/boost/ticket/5697 for details. It's … … 81 80 // and if it wasn't modify this test accordingly and update the 82 81 // docs in 'yat/omic/BamPairIterator.h'. 83 #if BOOST_VERSION > 10480084 82 result.back().first() = piter->first(); 85 83 result.back().second() = piter->second(); 86 #endif87 84 } 88 85 // not really doing anything since we've already iterated through -
trunk/yat/omic/BamPairIterator.h
r3193 r3197 27 27 #include "BamPair.h" 28 28 #include "BamRead.h" 29 30 #include <yat/utility/yat_assert.h> 29 31 30 32 #include <boost/concept/assert.hpp> … … 84 86 */ 85 87 explicit BamPairIterator(Base begin, Base end); 88 89 #if BOOST_VERSION < 104900 90 /** 91 This is workaround implementation of operator-> when 92 implementation in base class (boost) does not compile. This 93 implementation may be slow, so when using old boost it often 94 prefereble to use operator*. 95 */ 96 typename BamPairIterator::pointer operator->(void) const 97 { 98 // older versions of boost mandates pointer to be 99 // value_type*. To accomplish that we implement this slow thing 100 // which keeps a copy of a value_type as member. 101 // See https://svn.boost.org/trac/boost/ticket/5697 for discussion. 102 103 // Possibly stupid to assign each time, but why bother optimize 104 // for old bugs in boost. Users who are eager for speed, should 105 // either upgrade their boost or use (*iterator).function() 106 // rather than iterator->function(). 107 YAT_ASSERT(mate_); 108 YAT_ASSERT(iter_ != end_); 109 dummie_.first() = *mate_; 110 dummie_.second() = *iter_; 111 return &dummie_; 112 } 113 private: 114 mutable BamPair dummie_; 115 #endif 116 86 117 private: 87 118 Base iter_;
Note: See TracChangeset
for help on using the changeset viewer.