Merge from rc2.0
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2713 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
71864c2a6e
commit
409a1b21b8
1731 changed files with 104909 additions and 64375 deletions
48
trunk/eo/test/t-eoFunctor.cpp
Normal file
48
trunk/eo/test/t-eoFunctor.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue