CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 5 of 5 FirstFirst ... 2345
Results 61 to 65 of 65
  1. #61
    Join Date
    Apr 1999
    Posts
    27,449

    Re: [RESOLVED] template for events

    Quote Originally Posted by Cambalinho View Post
    events a();
    a={ cout << "hello world";};

    (in other place we can change what a do)
    Have you considered making "a" a function object (functor), and not just a plain function? A function object would encapsulate any behaviour you want, including changing .

    Regards,

    Paul McKenzie

  2. #62
    Join Date
    Apr 2009
    Posts
    1,355

    Re: [RESOLVED] template for events

    Quote Originally Posted by Paul McKenzie View Post
    Have you considered making "a" a function object (functor), and not just a plain function? A function object would encapsulate any behaviour you want, including changing .

    Regards,

    Paul McKenzie
    yes, my template is good for that, but i must repeat the types

  3. #63
    Join Date
    Apr 1999
    Posts
    27,449

    Re: [RESOLVED] template for events

    Quote Originally Posted by Cambalinho View Post
    yes, my template is good for that, but i must repeat the types
    But as stated by 2kaud, we have to know what you're trying to achieve, and need it explained without showing C++ code or referring to the C++ language. It still isn't clear why you "must repeat the types", and even that isn't a clear description.

    You're basically giving us your "solution", and no matter how hard you will fight, you're trying to make C++ syntax fit your "solution".

    I'll try to ask the question differently -- what problem are you trying to solve? Or is it that you aren't trying to solve a problem, but trying to make C++ look like another computer language?

    Regards,

    Paul McKenzie

  4. #64
    Join Date
    Apr 2009
    Posts
    1,355

    Re: [RESOLVED] template for events

    Quote Originally Posted by Paul McKenzie View Post
    But as stated by 2kaud, we have to know what you're trying to achieve, and need it explained without showing C++ code or referring to the C++ language. It still isn't clear why you "must repeat the types", and even that isn't a clear description.

    You're basically giving us your "solution", and no matter how hard you will fight, you're trying to make C++ syntax fit your "solution".

    I'll try to ask the question differently -- what problem are you trying to solve? Or is it that you aren't trying to solve a problem, but trying to make C++ look like another computer language?

    Regards,

    Paul McKenzie
    is for be more easy tranform my new language to C++ and the G++ compile it

  5. #65
    Join Date
    Apr 1999
    Posts
    27,449

    Re: [RESOLVED] template for events

    Quote Originally Posted by Cambalinho View Post
    is for be more easy tranform my new language to C++ and the G++ compile it
    To write such an application requires you to know both your "new language" and the C++ language at expert level. Otherwise you get yourself into situations like this.

    Second, what exactly is in this new language that you're having trouble translated to C++? Show us this "new language", and you will get much better responses.

    Since you undoubtedly do not know C++ at the expert level, let experts here look at your new language, and then give you advice on what possible ways to implement this in C++. The answers given may be totally different than what you came up with as a "solution".

    Regards,

    Paul McKenzie

Page 5 of 5 FirstFirst ... 2345

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured