C
Chameleon
I totally messed up with this:
We have
--------------------------------------
generate(v.begin(), v.end(), my_func);
--------------------------------------
and my_func:
-----------
int my_func();
-----------
So, if my_func() does not take parameters, how can generate data?
I see in examples, it uses static variables, but it isn't thread-safe.
I have a class, and I want from data of class produce values to fill
vector v. But in my case my_func() MUST NOT be static. How can I pass a
non-static member function to generate()?
------------------------------------------------
template<class ForwardIterator, class Generator>
void generate(
ForwardIterator _First,
ForwardIterator _Last,
Generator _Gen
);
------------------------------------------------
What is "class Generator"?
Is something like "Interface" in Java?
I must implement a specific method in my class, and my class must derive
from Generator?
thanks and sorry for my bombing (3 questions in a day)
We have
--------------------------------------
generate(v.begin(), v.end(), my_func);
--------------------------------------
and my_func:
-----------
int my_func();
-----------
So, if my_func() does not take parameters, how can generate data?
I see in examples, it uses static variables, but it isn't thread-safe.
I have a class, and I want from data of class produce values to fill
vector v. But in my case my_func() MUST NOT be static. How can I pass a
non-static member function to generate()?
------------------------------------------------
template<class ForwardIterator, class Generator>
void generate(
ForwardIterator _First,
ForwardIterator _Last,
Generator _Gen
);
------------------------------------------------
What is "class Generator"?
Is something like "Interface" in Java?
I must implement a specific method in my class, and my class must derive
from Generator?
thanks and sorry for my bombing (3 questions in a day)