fork(2) download
  1. #include <functional>
  2.  
  3. template<typename T>
  4. class Value {
  5. std::function<T()> get;
  6. public:
  7.  
  8. template<class Y>
  9. Value(Y lambda ) : get( std::move( lambda ) ) {}
  10. };
  11.  
  12. int main()
  13. {
  14. Value<double> d = [] { return 1.; };
  15. }
Success #stdin #stdout 0s 4368KB
stdin
Standard input is empty
stdout
Standard output is empty