costrlen.hpp File Reference


Detailed Description

Defines a macro for obtaining the size out of a compiled-in C string.

This macro allows to avoid the strlen overhead for strings known at compile-time.
Usage example:

 void doSomething(char const* str, int strLen);
 void someFunc() {
   std::pair<char const*, int> str = S("some text");
   doSomething (str.first, str.second);
 }

#include <utility>

Go to the source code of this file.

Defines

#define S(conststring)   std::pair<char const*, int>(conststring, sizeof(conststring) - 1)
 This macro allows to avoid the strlen overhead for strings known at compile-time.


Generated on Fri Nov 24 20:57:37 2006 for libglim by  doxygen 1.4.6