Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - the "template_depth" pragma provides a hard limit for the amount of nested http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The "template_depth" pragma provides a hard limit for the amount of nested
template expansions allowed so that infinite expansion can be detected.

The form of the "template_depth" pragma is as follows.

+--------------------------------------------------------------------------+
|      #pragma template_depth [(] n [)] [;]                                |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

n
    is the depth of expansion.  If the value of n is less than 2, if will
    default to 2.  If n is not specified, a warning message will be issued
    and the default value for n will be 100.

The following example of recursive template expansion illustrates why this
pragma can be useful.

Example:

     #pragma template_depth(10);

     template <class T>
     struct S {
         S<T*> x;
     };

     S<char> v;

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson