Page MenuHomeHEPForge

test_Functors.cc
No OneTemporary

Size
644 B
Referenced Files
None
Subscribers
None

test_Functors.cc

#include "UnitTest++.h"
#include "test_utils.hh"
#include "npstat/nm/SimpleFunctors.hh"
using namespace npstat;
namespace {
struct Dummy : public Functor1<int, int>
{
int operator()(const int& i) const {return i;}
};
struct Dummy2 : public Functor1<void, int>
{
void operator()(const int&) const {}
};
struct Dummy3 : public Functor0<void>
{
void operator()() const {}
};
TEST(Functor1)
{
Dummy d;
CHECK_EQUAL(3, d(3));
Dummy2 d2;
d2(3);
Dummy3 d3;
d3();
FcnFunctor0<double> f0(test_rng);
f0();
}
}

File Metadata

Mime Type
text/x-c
Expires
Tue, Sep 30, 5:45 AM (11 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6548164
Default Alt Text
test_Functors.cc (644 B)

Event Timeline