digitalmars.D.learn - Converting some C++ code help.
- rookie (13/13) Aug 02 2012 Hi,
- Philippe Sigaud (19/29) Aug 02 2012 in D, a free function would be:
Hi, I have the following C++ code, what would be the equivalent D code; template <class T> T Test<T>::pop(int ind) { T pop = T(); // Stuff that not important //.... return pop; } Thanks, rookie
Aug 02 2012
On Thu, Aug 2, 2012 at 7:59 PM, rookie <rookie rooki.com> wrote:Hi, I have the following C++ code, what would be the equivalent D code;IIRC, Test<T>::pop is a method definition, right ?template <class T> T Test<T>::pop(int ind) { T pop = T(); // Stuff that not important //.... return pop; }in D, a free function would be: T pop(T)(int ind) { T pop; return pop; } and, in a class: class Test(T) { T pop(int ind) { T pop; return pop; } } But then, my C++ is quite rusty, some I'm sure there are some gotchas that I forgot.
Aug 02 2012