This repository has been archived on 2026-03-28. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
eodev/eo/test/t-eoFunctor.cpp
mac ff108477c3 eoCounter?
eoEasyEA -- made it copyable again
eoEvalFunc -- added specialized eoEvalFuncCounter
eoEvolutionStrategy -- nothing much
eoGenContinue -- nothing
eoPop -- fixed nth_element_fitness
eoBitOp -- fixed error in xover
eoFileMonitor -- now appends always
eoParam -- worked around memory leak in MSC's strstream
eoParser -- changed -pconfig_file to @config_file
eoParser -- added messages instead of exception when required param is missing
eoStat -- added eoDistanceStat
t-eoFunctor -- don't know
2000-08-23 12:03:01 +00:00

49 lines
No EOL
720 B
C++

#include <eoInit.h>
#include <eoCounter.h>
void f(eoInit<int>& func)
{
int i;
func(i);
}
class Tester : public eoInit<int>
{
public :
void operator()(int& i)
{
i=1;
}
};
#include <iostream>
#include <eoFixedLength.h>
#include <eoVariableLength.h>
using namespace std;
int main(void)
{
Tester test;
eoFunctorStore store;
/// make a counter and store it in 'store'
eoInit<int>& cntr = make_counter(functor_category(test), test, store);
eoUnaryFunctorCounter<eoInit<int> > cntr2(test);
f(cntr);
f(cntr2);
f(cntr2);
f(test);
typedef eoVariableLength<double, int> EoType;
EoType eo;
eo.push_back(1);
eo.push_back(2);
return 1;
}