Browse Source

Fix const

Eric Ramat 5 years ago
parent
commit
0e018c8be4

+ 8 - 7
src/tests/dsde/models.hpp

@@ -61,7 +61,7 @@ namespace artis {
 
                 ~Beep() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -83,7 +83,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                dext(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -105,8 +106,8 @@ namespace artis {
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type /* e */,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -128,7 +129,7 @@ namespace artis {
                 }
 
                 void
-                start(typename common::DoubleTime::type t) override
+                start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -148,7 +149,7 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type t) const override
+                ta(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -172,7 +173,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE

+ 6 - 6
src/tests/dtss/models.hpp

@@ -57,7 +57,7 @@ namespace artis {
                 ~A() override = default;
 
                 void transition(const artis::common::Bag<artis::common::DoubleTime>& /* x */,
-                        artis::common::DoubleTime::type t) override
+                        const artis::common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -76,7 +76,7 @@ namespace artis {
 
                 }
 
-                void start(artis::common::DoubleTime::type t) override
+                void start(const artis::common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -95,7 +95,7 @@ namespace artis {
 
                 }
 
-                artis::common::Bag<artis::common::DoubleTime> lambda(artis::common::DoubleTime::type t) const override
+                artis::common::Bag<artis::common::DoubleTime> lambda(const artis::common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -148,7 +148,7 @@ namespace artis {
                 ~B() override = default;
 
                 void transition(const artis::common::Bag<artis::common::DoubleTime>& x,
-                        artis::common::DoubleTime::type t) override
+                        const artis::common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -168,7 +168,7 @@ namespace artis {
 #endif
                 }
 
-                void start(artis::common::DoubleTime::type t) override
+                void start(const artis::common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -188,7 +188,7 @@ namespace artis {
                 }
 
                 artis::common::Bag<artis::common::DoubleTime> lambda(
-                        artis::common::DoubleTime::type t) const override
+                        const artis::common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE

+ 4 - 4
src/tests/dtss/tests.cpp

@@ -40,6 +40,7 @@ using namespace artis::common;
 TEST_CASE("dtss/only_one", "run")
 {
     artis::common::context::Context<artis::common::DoubleTime> context(0, 10);
+    artis::dtss::Parameters<DoubleTime> parameters = {1};
     artis::common::RootCoordinator<
             DoubleTime, artis::dtss::Coordinator<
                     DoubleTime,
@@ -47,7 +48,7 @@ TEST_CASE("dtss/only_one", "run")
                     OnlyOneGraphManager,
                     artis::dtss::Parameters<DoubleTime>,
                     artis::common::NoParameters>
-    > rc(context, "root", artis::dtss::Parameters<DoubleTime>(1), artis::common::NoParameters());
+    > rc(context, "root", parameters, artis::common::NoParameters());
 
     artis::common::Trace<DoubleTime>::trace().clear();
     rc.run(context);
@@ -71,15 +72,14 @@ TEST_CASE("dtss/only_one", "run")
 TEST_CASE("dtss/two", "run")
 {
     artis::common::context::Context<artis::common::DoubleTime> context(0, 10);
+    artis::dtss::Parameters<DoubleTime> parameters = {1};
     artis::common::RootCoordinator<
             DoubleTime, artis::dtss::Coordinator<
                     DoubleTime,
                     artis::dtss::LastBagPolicy,
                     TwoGraphManager,
                     artis::dtss::Parameters<DoubleTime> >
-    > rc(context, "root",
-            artis::dtss::Parameters<DoubleTime>(1),
-            artis::common::NoParameters());
+    > rc(context, "root", parameters, artis::common::NoParameters());
 
     artis::common::Trace<DoubleTime>::trace().clear();
     rc.run(context);

+ 1 - 1
src/tests/mixed/graph_manager.hpp

@@ -121,7 +121,7 @@ namespace artis {
                         :
                         pdevs::GraphManager<common::DoubleTime>(coordinator, parameters, graph_parameters),
                         S1("S1", artis::common::NoParameters(), artis::common::NoParameters()),
-                        S2("S2", artis::dtss::Parameters<common::DoubleTime>(2), artis::common::NoParameters())
+                        S2("S2", {2}, artis::common::NoParameters())
                 {
                     add_child(OneS1, &S1);
                     add_child(OneS2, &S2);

+ 32 - 28
src/tests/mixed/models.hpp

@@ -60,7 +60,7 @@ namespace artis {
 
                 ~A1() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -82,7 +82,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                dext(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -104,8 +105,8 @@ namespace artis {
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type /* e */,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -125,7 +126,7 @@ namespace artis {
 #endif
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -144,7 +145,7 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type t) const override
+                ta(const typename common::DoubleTime::type& t) const override
                 {
 #ifndef WITH_TRACE
                     (void)t;
@@ -166,7 +167,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -220,7 +221,7 @@ namespace artis {
 
                 ~B1() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -242,7 +243,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type e,
+                dext(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& e,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -257,14 +259,15 @@ namespace artis {
 #endif
 
                     std::for_each(bag.begin(), bag.end(),
-                            [this, t, e](const common::ExternalEvent<common::DoubleTime>& /* event */) {
+                            [this, t, e](
+                                    const common::ExternalEvent<common::DoubleTime>& /* event */) {
                                 ++_count;
                             });
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type e,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& e,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -288,7 +291,7 @@ namespace artis {
 
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -309,7 +312,7 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type t) const override
+                ta(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -333,7 +336,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -389,7 +392,7 @@ namespace artis {
                 ~A2() override = default;
 
                 void transition(const common::Bag<common::DoubleTime>& x,
-                        typename common::DoubleTime::type t) override
+                        const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -409,7 +412,7 @@ namespace artis {
 
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -427,7 +430,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -478,7 +481,7 @@ namespace artis {
                 ~B2() override = default;
 
                 void transition(const common::Bag<common::DoubleTime>& x,
-                        typename common::DoubleTime::type t) override
+                        const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -498,7 +501,7 @@ namespace artis {
 
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -518,7 +521,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -566,7 +569,7 @@ namespace artis {
 
                 ~Beep() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -588,7 +591,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                dext(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -610,8 +614,8 @@ namespace artis {
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type /* e */,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
 
@@ -632,7 +636,7 @@ namespace artis {
 
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -652,7 +656,7 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type t) const override
+                ta(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -676,7 +680,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE

+ 8 - 7
src/tests/multithreading/lifegame/models.hpp

@@ -70,7 +70,7 @@ namespace artis {
 
                     ~Cell() override = default;
 
-                    void dint(typename common::DoubleTime::type /* t */) override
+                    void dint(const typename common::DoubleTime::type& /* t */) override
                     {
                         if (_phase == SEND) {
                             _phase = WAIT;
@@ -89,8 +89,8 @@ namespace artis {
                         }
                     }
 
-                    void dext(typename common::DoubleTime::type /* t */,
-                            typename common::DoubleTime::type /* e */,
+                    void dext(const typename common::DoubleTime::type& /* t */,
+                            const typename common::DoubleTime::type& /* e */,
                             const common::Bag<common::DoubleTime>& bag) override
                     {
                         std::for_each(bag.begin(), bag.end(),
@@ -115,13 +115,14 @@ namespace artis {
                     }
 
                     void
-                    dconf(typename common::DoubleTime::type t, typename common::DoubleTime::type e,
+                    dconf(const typename common::DoubleTime::type& t,
+                            const typename common::DoubleTime::type& e,
                             const common::Bag<common::DoubleTime>& bag) override
                     {
                         dext(t, e, bag);
                     }
 
-                    void start(typename common::DoubleTime::type t) override
+                    void start(const typename common::DoubleTime::type& t) override
                     {
                         (void) t;
 
@@ -133,13 +134,13 @@ namespace artis {
                     }
 
                     typename common::DoubleTime::type
-                    ta(typename common::DoubleTime::type /* t */) const override
+                    ta(const typename common::DoubleTime::type& /* t */) const override
                     {
                         return _sigma;
                     }
 
                     common::Bag<common::DoubleTime>
-                    lambda(typename common::DoubleTime::type /* t */) const override
+                    lambda(const typename common::DoubleTime::type& /* t */) const override
                     {
                         common::Bag<common::DoubleTime> bag;
 

+ 39 - 27
src/tests/pdevs/models.hpp

@@ -52,6 +52,16 @@ namespace artis {
                         :x(_x), y(_y) { }
             };
 
+            class Inactive : public artis::pdevs::Dynamics<common::DoubleTime, Inactive> {
+            public:
+                Inactive(const std::string& name,
+                        const artis::pdevs::Context<common::DoubleTime, Inactive>& context)
+                        :
+                        artis::pdevs::Dynamics<common::DoubleTime, Inactive>(name, context) { }
+
+                ~Inactive() override = default;
+            };
+
             class A : public artis::pdevs::Dynamics<common::DoubleTime, A> {
             public:
                 enum inputs {
@@ -72,7 +82,7 @@ namespace artis {
 
                 ~A() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -98,7 +108,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                dext(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& msgs) override
                 {
 
@@ -120,8 +131,8 @@ namespace artis {
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type /* e */,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& msgs) override
                 {
 
@@ -142,7 +153,7 @@ namespace artis {
 
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -162,7 +173,7 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type t) const override
+                ta(const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -186,7 +197,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 #ifndef WITH_TRACE
                     (void)t;
@@ -241,7 +252,7 @@ namespace artis {
 
                 ~B() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -263,7 +274,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type t, typename common::DoubleTime::type /* e */,
+                dext(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& msgs) override
                 {
 
@@ -285,8 +297,8 @@ namespace artis {
                     _phase = SEND;
                 }
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type e,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& e,
                         const common::Bag<common::DoubleTime>& msgs) override
                 {
 
@@ -309,7 +321,7 @@ namespace artis {
 
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
 
 #ifndef WITH_TRACE
@@ -329,7 +341,7 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type ta(
-                        typename common::DoubleTime::type t) const override
+                        const typename common::DoubleTime::type& t) const override
                 {
 
 #ifndef WITH_TRACE
@@ -353,7 +365,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime> lambda(
-                        typename common::DoubleTime::type t) const override
+                        const typename common::DoubleTime::type& t) const override
                 {
 #ifndef WITH_TRACE
                     (void)t;
@@ -396,7 +408,7 @@ namespace artis {
 
                 ~TwoStateModel() override = default;
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
                     if (_phase == S1) {
                         _phase = S2;
@@ -406,14 +418,14 @@ namespace artis {
                     _last_time = t;
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
                     _phase = S1;
                     _last_time = t;
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type /* t */) const override
+                ta(const typename common::DoubleTime::type& /* t */) const override
                 {
                     if (_phase == S1) {
                         return 5;
@@ -423,7 +435,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type t) const override
+                lambda(const typename common::DoubleTime::type& t) const override
                 {
 
                     std::cout << (t - _last_time) << std::endl;
@@ -468,15 +480,15 @@ namespace artis {
 
                 ~ThreeStateModel() override = default;
 
-                void dconf(typename common::DoubleTime::type t,
-                        typename common::DoubleTime::type e,
+                void dconf(const typename common::DoubleTime::type& t,
+                        const typename common::DoubleTime::type& e,
                         const common::Bag<common::DoubleTime>& msgs) override
                 {
                     dext(t, e, msgs);
                 }
 
-                void dext(typename common::DoubleTime::type /* t */,
-                        typename common::DoubleTime::type /* e */,
+                void dext(const typename common::DoubleTime::type& /* t */,
+                        const typename common::DoubleTime::type& /* e */,
                         const common::Bag<common::DoubleTime>& msgs) override
                 {
                     for (common::Bag<common::DoubleTime>::const_iterator it = msgs.begin();
@@ -504,7 +516,7 @@ namespace artis {
                     }
                 }
 
-                void dint(typename common::DoubleTime::type t) override
+                void dint(const typename common::DoubleTime::type& t) override
                 {
                     mark_full(t);
                     if (full_N()) {
@@ -513,7 +525,7 @@ namespace artis {
                     compute();
                 }
 
-                void start(typename common::DoubleTime::type t) override
+                void start(const typename common::DoubleTime::type& t) override
                 {
                     heights = {0, 0, 0, 0, 0};
                     speeds = {0.21, 0.3, 0.7, 0.56, 0.14};
@@ -525,10 +537,10 @@ namespace artis {
                 }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type /* t */) const override { return sigma; }
+                ta(const typename common::DoubleTime::type& /* t */) const override { return sigma; }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type /* t */) const override
+                lambda(const typename common::DoubleTime::type& /* t */) const override
                 {
                     common::Bag<common::DoubleTime> msgs;
 
@@ -596,7 +608,7 @@ namespace artis {
                     return n >= 2;
                 }
 
-                void mark_full(typename common::DoubleTime::type t)
+                void mark_full(const typename common::DoubleTime::type& t)
                 {
                     for (std::vector<double>::iterator it = heights.begin();
                          it != heights.end(); ++it) {

+ 12 - 0
src/tests/pdevs/tests.cpp

@@ -36,6 +36,18 @@
 using namespace artis::tests::pdevs;
 using namespace artis::common;
 
+TEST_CASE("pdevs/inactive", "run")
+{
+    artis::common::context::Context<artis::common::DoubleTime> context(0, 10);
+    artis::common::RootCoordinator<
+            DoubleTime, artis::pdevs::Coordinator<
+                    DoubleTime,
+                    OnlyOneGraphManager<Inactive> >
+    > rc(context, "root");
+
+    rc.run(context);
+}
+
 TEST_CASE("pdevs/only_one", "run")
 {
     artis::common::context::Context<artis::common::DoubleTime> context(0, 10);

+ 7 - 5
src/tests/qss/models.hpp

@@ -180,7 +180,7 @@ namespace artis {
 
                 ~SmartGardener() override = default;
 
-                void dint(typename common::DoubleTime::type /* t */) override
+                void dint(const typename common::DoubleTime::type& /* t */) override
                 {
                     switch (_phase) {
                     case INIT:
@@ -203,7 +203,8 @@ namespace artis {
                 }
 
                 void
-                dext(typename common::DoubleTime::type /* t */, typename common::DoubleTime::type e,
+                dext(const typename common::DoubleTime::type& /* t */,
+                        const typename common::DoubleTime::type& e,
                         const common::Bag<common::DoubleTime>& bag) override
                 {
                     std::for_each(bag.begin(), bag.end(),
@@ -220,10 +221,11 @@ namespace artis {
                     _sigma -= e;
                 }
 
-                void start(typename common::DoubleTime::type /* t */) override { _phase = INIT; }
+                void
+                start(const typename common::DoubleTime::type& /* t */) override { _phase = INIT; }
 
                 typename common::DoubleTime::type
-                ta(typename common::DoubleTime::type /* t */) const override
+                ta(const typename common::DoubleTime::type& /* t */) const override
                 {
                     switch (_phase) {
                     case INIT:
@@ -237,7 +239,7 @@ namespace artis {
                 }
 
                 common::Bag<common::DoubleTime>
-                lambda(typename common::DoubleTime::type /* t */) const override
+                lambda(const typename common::DoubleTime::type& /* t */) const override
                 {
                     common::Bag<common::DoubleTime> bag;