Create and declare new type...

Discussion in 'C++' started by Noah Roberts, Mar 22, 2011.

  1. Noah Roberts

    Noah Roberts Guest

    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
     
    Noah Roberts, Mar 22, 2011
    #1
    1. Advertising

  2. 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
     
    Victor Bazarov, Mar 22, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oliver Wong
    Replies:
    16
    Views:
    623
    Oliver Wong
    Jun 28, 2006
  2. Weng Tianxiang

    How to declare a port with a new type

    Weng Tianxiang, Jul 7, 2010, in forum: VHDL
    Replies:
    8
    Views:
    687
    Martin Thompson
    Jul 16, 2010
  3. Jim Langston
    Replies:
    2
    Views:
    517
    Jim Langston
    Oct 22, 2010
  4. PerlFAQ Server

    FAQ 7.8 How do I declare/create a structure?

    PerlFAQ Server, Feb 12, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    110
    PerlFAQ Server
    Feb 12, 2011
  5. PerlFAQ Server

    FAQ 7.8 How do I declare/create a structure?

    PerlFAQ Server, Feb 22, 2011, in forum: Perl Misc
    Replies:
    0
    Views:
    106
    PerlFAQ Server
    Feb 22, 2011
Loading...

Share This Page