Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Create and declare new type... (http://www.velocityreviews.com/forums/t745497-create-and-declare-new-type.html)

Noah Roberts 03-22-2011 12:09 AM

Create and declare new type...
 
I'm looking for something such that I can:

MACRO(xxx) * funny;

This will declare a pointer to a struct with a virtual function called
'xxx' with void() signature.

Furthermore I want to be able to:

some_template<MACRO(xxx)>

thus I don't believe that macro can simply be "struct { virtual void
xxx() = 0; }"

Been playing around with decltype. Seems to me that something should be
possible here but I can't find it so far.

--
http://crazycpp.wordpress.com

Victor Bazarov 03-22-2011 12:09 PM

Re: Create and declare new type...
 
On 3/21/2011 8:09 PM, Noah Roberts wrote:
> I'm looking for something such that I can:
>
> MACRO(xxx) * funny;
>
> This will declare a pointer to a struct with a virtual function called
> 'xxx' with void() signature.
>
> Furthermore I want to be able to:
>
> some_template<MACRO(xxx)>
>
> thus I don't believe that macro can simply be "struct { virtual void
> xxx() = 0; }"
>
> Been playing around with decltype. Seems to me that something should be
> possible here but I can't find it so far.


Might be simpler to have two macros for that...

V
--
I do not respond to top-posted replies, please don't ask


All times are GMT. The time now is 05:01 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57