36 template <
typename SensorFnT>
37 class sensor :
private detail::watchable<
38 estd::decay_t<estd::result_of_t<SensorFnT()> > >
40 using signal_ptr_t = decltype(
41 detail::make_sensor_signal(std::declval<SensorFnT>()));
46 : signal_(detail::make_sensor_signal(SensorFnT())) {}
48 : signal_(detail::make_sensor_signal(std::move(fn))) {}
55 const value_type&
get()
const
57 return signal_->last();
61 const signal_ptr_t& signal() {
return signal_; }
62 const signal_ptr_t& roots() {
return signal_; }
64 friend class detail::access;
68 template <
typename SensorFnT>
typename std::decay< T >::type decay_t
Similar to C++14 std::decay_t.
C++ amazing templates and reusable implementations awesomeness.