| ... | ... |
@@ -1342,25 +1342,25 @@ |
| 1342 | 1342 |
public: |
| 1343 | 1343 |
typedef typename Container::value_type Key; |
| 1344 | 1344 |
typedef bool Value; |
| 1345 | 1345 |
|
| 1346 | 1346 |
/// Constructor |
| 1347 | 1347 |
FrontInserterBoolMap(Container& _container, |
| 1348 | 1348 |
const Functor& _functor = Functor()) |
| 1349 | 1349 |
: container(_container), functor(_functor) {}
|
| 1350 | 1350 |
|
| 1351 | 1351 |
/// The \c set function of the map |
| 1352 | 1352 |
void set(const Key& key, Value value) {
|
| 1353 | 1353 |
if (value) {
|
| 1354 |
container.push_front(key); |
|
| 1354 |
container.push_front(functor(key)); |
|
| 1355 | 1355 |
} |
| 1356 | 1356 |
} |
| 1357 | 1357 |
|
| 1358 | 1358 |
private: |
| 1359 | 1359 |
Container& container; |
| 1360 | 1360 |
Functor functor; |
| 1361 | 1361 |
}; |
| 1362 | 1362 |
|
| 1363 | 1363 |
/// \brief Writable bool map for storing each \c true assigned element in |
| 1364 | 1364 |
/// an insertable container. |
| 1365 | 1365 |
/// |
| 1366 | 1366 |
/// Writable bool map for storing each \c true assigned element in an |
| ... | ... |
@@ -1399,25 +1399,25 @@ |
| 1399 | 1399 |
/// Constructor |
| 1400 | 1400 |
|
| 1401 | 1401 |
/// Constructor without specified iterator. |
| 1402 | 1402 |
/// The elements will be inserted before <tt>_container.end()</tt>. |
| 1403 | 1403 |
/// \param _container The container for storing the elements. |
| 1404 | 1404 |
/// \param _functor The functor that is used when an element is stored. |
| 1405 | 1405 |
InserterBoolMap(Container& _container, const Functor& _functor = Functor()) |
| 1406 | 1406 |
: container(_container), it(_container.end()), functor(_functor) {}
|
| 1407 | 1407 |
|
| 1408 | 1408 |
/// The \c set function of the map |
| 1409 | 1409 |
void set(const Key& key, Value value) {
|
| 1410 | 1410 |
if (value) {
|
| 1411 |
it = container.insert(it, key); |
|
| 1411 |
it = container.insert(it, functor(key)); |
|
| 1412 | 1412 |
++it; |
| 1413 | 1413 |
} |
| 1414 | 1414 |
} |
| 1415 | 1415 |
|
| 1416 | 1416 |
private: |
| 1417 | 1417 |
Container& container; |
| 1418 | 1418 |
typename Container::iterator it; |
| 1419 | 1419 |
Functor functor; |
| 1420 | 1420 |
}; |
| 1421 | 1421 |
|
| 1422 | 1422 |
/// \brief Writable bool map for filling each \c true assigned element with a |
| 1423 | 1423 |
/// given value. |
0 comments (0 inline)