Sprout/sprout/weed/expr/expr.hpp

36 lines
866 B
C++
Raw Normal View History

2011-11-13 08:54:38 +00:00
#ifndef SPROUT_WEED_EXPR_EXPR_HPP
#define SPROUT_WEED_EXPR_EXPR_HPP
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/weed/expr/expr_fwd.hpp>
#include <sprout/weed/expr/tag.hpp>
#include <sprout/weed/traits/expr/expr_of.hpp>
2011-11-13 08:54:38 +00:00
namespace sprout {
namespace weed {
//
// expr
//
template<typename Tag, typename... Args>
class expr {
public:
typedef Tag expr_tag;
typedef sprout::tuples::tuple<Args...> args_type;
private:
args_type args_;
public:
template<typename... As>
2012-04-11 14:28:29 +00:00
explicit SPROUT_CONSTEXPR expr(As&&... args)
2011-11-13 08:54:38 +00:00
: args_(sprout::forward<As>(args)...)
{}
SPROUT_CONSTEXPR args_type const& args() const {
return args_;
}
};
} // namespace weed
} // namespace sprout
#endif // #ifndef SPROUT_WEED_EXPR_EXPR_HPP