RAD Studio |  |

E2301: Cannot use templates in closure arguments -- use a typedef (C++)
Example
Collapse All

When declaring a closure type, the arguments passed to that closure must be of a simple type. Templates are not accepted. To pass a reference to an object of template type to a closure, you must declare a typedef, which counts as a simple type name.

Example
Copy Code

    typedef my_class<int> mci;
    typedef void (__closure * func) (const mci& object);

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!