Changeset 2260
- Timestamp:
- May 26, 2010, 1:48:54 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/Suite.h
r2228 r2260 217 217 column_iterator end_column(size_t) { return NULL; } 218 218 iterator end_row(size_t) { return NULL; } 219 reference operator()(size_t row, size_t column) const219 reference operator()(size_t row, size_t column) 220 220 { return this->element_; } 221 221 }; -
trunk/test/concept_test.cc
r2259 r2260 24 24 #include "yat/utility/concept_check.h" 25 25 #include "yat/utility/DataWeight.h" 26 #include "yat/utility/Matrix.h" 27 #include "yat/utility/MatrixWeighted.h" 26 28 27 29 #include "yat/classifier/MatrixLookup.h" … … 36 38 test::Suite suite(argc, argv); 37 39 using namespace utility; 40 using namespace test; 38 41 39 42 BOOST_CONCEPT_ASSERT((Container2D<test::container2d_archetype<double> >)); … … 44 47 // BOOST_CONCEPT_ASSERT((Container2D<classifier::KernelLookup>)); 45 48 49 // concept Mutable_Container2D 50 BOOST_CONCEPT_ASSERT((Mutable_Container2D<mutable_container2d_archetype<double> >)); 51 BOOST_CONCEPT_ASSERT((Mutable_Container2D<mutable_container2d_archetype<DataWeight> >)); 52 BOOST_CONCEPT_ASSERT((Mutable_Container2D<Matrix>)); 53 BOOST_CONCEPT_ASSERT((Mutable_Container2D<MatrixWeighted>)); 54 55 56 46 57 return suite.return_value(); 47 58 } -
trunk/yat/utility/concept_check.h
r2259 r2260 85 85 }; 86 86 87 /** 88 \brief Concept check for \ref concept_mutable_container_2d 89 90 This class is intended to be used in a <a 91 href="\boost_url/concept_check/using_concept_check.htm"> 92 BOOST_CONCEPT_ASSERT </a> 93 94 \code 95 template<class T> 96 void some_function(const T& t) 97 { 98 BOOST_CONCEPT_ASSERT((Mutable_Container2D<T>)); 99 ... 100 } 101 \endcode 102 */ 103 template <class T> 104 class Mutable_Container2D : public Container2D<T> 105 { 106 public: 107 /// reference 108 typedef typename T::reference reference; 109 /// iterator 110 typedef typename T::iterator iterator; 111 /// row_iterator 112 typedef typename T::row_iterator row_iterator; 113 /// column_iterator 114 typedef typename T::column_iterator column_iterator; 115 116 /** 117 \brief function doing the concept test 118 */ 119 BOOST_CONCEPT_USAGE(Mutable_Container2D) 120 { 121 iterator iter_ = t_.begin(); 122 iter_ = t_.end(); 123 row_iterator row_iter_ = t_.begin_row(0); 124 row_iter_ = t_.end_row(0); 125 column_iterator col_iter_ = t_.begin_column(0); 126 col_iter_ = t_.end_column(0); 127 reference r = t_(0,0); 128 t_(0,0) = r; 129 using boost::Mutable_RandomAccessIterator; // just to avoid long lines 130 BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator<iterator>)); 131 BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator<row_iterator>)); 132 BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator<column_iterator>)); 133 } 134 private: 135 T t_; 136 }; 137 87 138 }}} // of namespace utility, yat, and theplu 88 139 #endif
Note: See TracChangeset
for help on using the changeset viewer.