Chris@16
|
1 /*-----------------------------------------------------------------------------+
|
Chris@16
|
2 Copyright (c) 2007-2009: Joachim Faulhaber
|
Chris@16
|
3 +------------------------------------------------------------------------------+
|
Chris@16
|
4 Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
|
Chris@16
|
5 +------------------------------------------------------------------------------+
|
Chris@16
|
6 Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
7 (See accompanying file LICENCE.txt or copy at
|
Chris@16
|
8 http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 +-----------------------------------------------------------------------------*/
|
Chris@16
|
10 /*-----------------------------------------------------------------------------
|
Chris@16
|
11 Macro definitions for some useful notations e.g. iteration headers
|
Chris@16
|
12 -----------------------------------------------------------------------------*/
|
Chris@16
|
13 #ifndef BOOST_ICL_DETAIL_NOTATE_HPP_JOFA_990119
|
Chris@16
|
14 #define BOOST_ICL_DETAIL_NOTATE_HPP_JOFA_990119
|
Chris@16
|
15
|
Chris@16
|
16
|
Chris@16
|
17 // Iterations over stl or stl-compatible containers:
|
Chris@16
|
18 #define ICL_FORALL(type,iter,obj) for(type::iterator iter=(obj).begin(); (iter)!=(obj).end(); (iter)++)
|
Chris@16
|
19 #define ICL_const_FORALL(type,iter,obj) for(type::const_iterator iter=(obj).begin(); !((iter)==(obj).end()); (iter)++)
|
Chris@16
|
20
|
Chris@16
|
21 #define ICL_FORALL_THIS(iter) for(iterator iter=begin(); (iter)!=end(); (iter)++)
|
Chris@16
|
22 #define ICL_const_FORALL_THIS(iter) for(const_iterator iter=this->begin(); (iter)!=this->end(); (iter)++)
|
Chris@16
|
23
|
Chris@16
|
24 // Plain old array iteration (assuming member function VecT::size()!)
|
Chris@16
|
25 #define ICL_FORALL_VEC(idx, vec) for(int idx=0; idx<vec.size(); idx++)
|
Chris@16
|
26
|
Chris@16
|
27 namespace boost{namespace icl
|
Chris@16
|
28 {
|
Chris@16
|
29 const int UNDEFINED_INDEX = -1;
|
Chris@16
|
30 }} // namespace icl boost
|
Chris@16
|
31
|
Chris@16
|
32
|
Chris@16
|
33 #endif // BOOST_ICL_DETAIL_NOTATE_HPP_JOFA_990119
|
Chris@16
|
34
|
Chris@16
|
35
|