KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
l_util.h
Go to the documentation of this file.
1 
2 /* $Id: l_util.h 18962 2015-04-28 00:51:55Z jguan1 $ */
3 
4 #ifndef KJB_WRAP_UTIL_H
5 #define KJB_WRAP_UTIL_H
6 
7 #include <stdlib.h>
8 
9 #define KJB(x) do {using namespace kjb_c; x;} while(0)
10 
11 namespace kjb {
12 
13 void alert_untested( int line, const char* file );
14 
16 template<class C>
17 size_t length(const C& cner)
18 {
19  size_t len = 0;
20  for(typename C::const_iterator p = cner.begin(); p != cner.end(); ++p)
21  {
22  len += p->size();
23  }
24 
25  return len;
26 }
27 
28 }
29 
30 #endif
31 
32 
void alert_untested(int line, const char *file)
size_t length(const C &cner)
Counts the total number of elements in a 2D STL-style container.
Definition: l_util.h:17