added impelementation-candidate for magic type-erasure nested class
This commit is contained in:
		
							
								
								
									
										11
									
								
								Function.hpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								Function.hpp
									
									
									
									
									
								
							@@ -11,5 +11,16 @@ private:
 | 
			
		||||
    public:
 | 
			
		||||
        virtual Ret call(Args...) = 0;
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    template <typename Fun>
 | 
			
		||||
    class callable : public callable_base
 | 
			
		||||
    {
 | 
			
		||||
    private:
 | 
			
		||||
        Fun _f;
 | 
			
		||||
    public:
 | 
			
		||||
        callable(Fun f):_f(f) {}
 | 
			
		||||
        virtual Ret call(Args... args)
 | 
			
		||||
        { return _f(std::forward<Args>(args)...); }
 | 
			
		||||
    };
 | 
			
		||||
public:
 | 
			
		||||
};
 | 
			
		||||
		Reference in New Issue
	
	Block a user