Home How do I declare a function in a C++ template delaration
Reply: 0

How do I declare a function in a C++ template delaration

user567
1#
user567 Published in April 25, 2018, 6:08 pm

In Ada I can define the following generic (Equivalent to a C++ template) :

Generic
With function Sum( .. ) return boolean
Package XXXX is ……
End package

And later the generic can be instantiated as follows

Package XXXX_1 is new XXXX( Sum => Sum_Int );

In other words I can create an Ada generic package which requires a function to instantiate it, now how do I do this in C++? ie

template < *function_declaration* >
    class Stack { 
    };
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.265019 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO