Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/libstdc++-devel-4.0.2/html/23_containers/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
/*****************************************************************
* Functions to help treat arrays in a uniform manner. These were
* inspired by a thread on comp.lang.c++.moderated, started by Dietmar
* Kuehl and contributed to by the rest of the entire planet.
*
* beginof (x), endof (x), lengthof (x) now accompany sizeof, where x
* can be either a container (currently only sequences) or a builtin
* array (/not/ a pointer). The beginof/endof are intended for use in
* the algorithms library, and lengthof is a "sizing" function.
*
* Note example:
* char an_array [17];
* cerr << lengthof(an_array) << endl;
* produces assembly code of
* mov 17,register0
* call ofstream_put
* i.e., the template function inlining really does work; g++
* requires -O3 (or -finline-functions) before it does this, though.
*
* pedwards 13Nov98
*/
// beginof
template <class T>
inline typename vector<T>::iterator beginof (vector<T> &v)
{ return v.begin(); }
template <class T, unsigned int sz>
inline T* beginof (T (&array)[sz]) { return array; }
// endof
template <class T>
inline typename vector<T>::iterator endof (vector<T> &v)
{ return v.end(); }
template <class T, unsigned int sz>
inline T* endof (T (&array)[sz]) { return array + sz; }
// lengthof
template <class T>
inline typename vector<T>::size_type lengthof (vector<T> &v)
{ return v.size(); }
template <class T, unsigned int sz>
inline unsigned int lengthof (T (&)[sz]) { return sz; }
|
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0031 ]-- |