Skip to content

Commit

Permalink
fix const
Browse files Browse the repository at this point in the history
  • Loading branch information
hideakitai committed May 19, 2020
1 parent 3260c2f commit 36d6bc2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ArduinoOSC/OSCServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,22 @@ namespace server {
}
};

// callback with const Message&
template <typename R>
class Function<R, const Message&> : public Base
{
using Func = std::function<R(const Message&)>;
Func func;
public:
Function(Func func) : func(func) {};
virtual ~Function() {}
virtual void decodeFrom(Message& m, size_t offset = 0) override
{
func(m);
(void)offset;
}
};

} // namespace element


Expand Down

0 comments on commit 36d6bc2

Please sign in to comment.