Changeset 69cc156 in mainline for uspace/lib/cpp/include/__bits
- Timestamp:
- 2018-07-05T21:41:24Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 09416c12
- Parents:
- ddd287d
- git-author:
- Dzejrou <dzejrou@…> (2018-05-17 23:46:22)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:24)
- Location:
- uspace/lib/cpp/include/__bits
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/__bits/functional/bind.hpp
rddd287d r69cc156 163 163 } 164 164 165 private: 166 function< decay_t<F>> func_;165 private: // TODO: This has problem with member function pointers. 166 function<remove_reference_t<F>> func_; 167 167 tuple<decay_t<Args>...> bound_args_; 168 168 … … 183 183 bind_arg_filter<ActualArgs...> filter{forward<ActualArgs>(args)...}; 184 184 185 return aux:: invoke(185 return aux::INVOKE( 186 186 func_, 187 187 filter[get<Is>(bound_args_)]... -
uspace/lib/cpp/include/__bits/functional/invoke.hpp
rddd287d r69cc156 52 52 53 53 template<class R, class T, class T1, class... Ts> 54 decltype(auto) invoke(R T::* f, T1&& t1, Ts&&... args)54 decltype(auto) INVOKE(R T::* f, T1&& t1, Ts&&... args) 55 55 { 56 56 if constexpr (is_member_function_pointer<decltype(f)>::value) … … 88 88 89 89 template<class F, class... Args> 90 decltype(auto) invoke(F&& f, Args&&... args)90 decltype(auto) INVOKE(F&& f, Args&&... args) 91 91 { 92 92 // (1.5) -
uspace/lib/cpp/include/__bits/functional/reference_wrapper.hpp
rddd287d r69cc156 75 75 76 76 template<class... Args> 77 result_of_t<type&(Args&&...)>operator()(Args&&... args) const77 decltype(auto) operator()(Args&&... args) const 78 78 { 79 return invoke(*data_, std::forward<Args>(args)...);79 return aux::INVOKE(*data_, std::forward<Args>(args)...); 80 80 } 81 81 -
uspace/lib/cpp/include/__bits/test/tests.hpp
rddd287d r69cc156 274 274 const char* name() override; 275 275 }; 276 277 class functional_test: public test_suite 278 { 279 public: 280 bool run(bool) override; 281 const char* name() override; 282 private: 283 void test_reference_wrapper(); 284 void test_function(); 285 void test_bind(); 286 }; 276 287 } 277 288 -
uspace/lib/cpp/include/__bits/type_traits/result_of.hpp
rddd287d r69cc156 62 62 is_class<typename decay<F>::type>::value || 63 63 is_member_pointer<typename decay<F>::type>::value, 64 decltype(aux:: invoke(declval<F>(), declval<ArgTypes>()...))64 decltype(aux::INVOKE(declval<F>(), declval<ArgTypes>()...)) 65 65 >::type 66 66 >
Note:
See TracChangeset
for help on using the changeset viewer.