-
November 8th, 2013, 12:52 PM
#61
Re: [RESOLVED] template for events
Originally Posted by Cambalinho
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
-
November 8th, 2013, 12:57 PM
#62
Re: [RESOLVED] template for events
Originally Posted by Paul McKenzie
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
-
November 8th, 2013, 01:13 PM
#63
Re: [RESOLVED] template for events
Originally Posted by Cambalinho
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
-
November 8th, 2013, 01:15 PM
#64
Re: [RESOLVED] template for events
Originally Posted by Paul McKenzie
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
-
November 8th, 2013, 01:42 PM
#65
Re: [RESOLVED] template for events
Originally Posted by Cambalinho
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|