33 template <
typename Tag>
40 template <
typename ValueSet>
41 value_impl(
const ValueSet& vs,
const typename ValueSet::value_t&
v)
42 : self_{std::make_shared<model<ValueSet>>(vs,
v)}
48 return self_->vname();
52 template <
typename ValueSet>
59 template <
typename ValueSet>
60 const auto&
as()
const 88 self_ = std::move(l.
self_);
96 virtual ~
base() =
default;
101 template <
typename ValueSet>
107 : valueset_(
std::move(vs))
108 , value_(
std::move(v))
113 return valueset().sname();
134 std::shared_ptr<base> self_ =
nullptr;
139 template <
typename ValueSetLhs,
typename ValueSetRhs,
typename Tag>
143 const auto& l = lhs->template as<ValueSetLhs>();
144 const auto&
r = rhs->template as<ValueSetRhs>();
145 auto rs =
join(l.valueset(), r.valueset());
146 auto lr = rs.conv(l.valueset(), l.value());
147 auto rr = rs.conv(r.valueset(), r.value());
148 return std::make_tuple(rs, lr, rr);
auto & operator=(std::nullptr_t)
value_impl * operator->()
symbol vname() const override
const valueset_t & valueset() const
value_impl(const ValueSet &vs, const typename ValueSet::value_t &v)
typename valueset_t::value_t value_t
auto & operator=(const value_impl &l)
const value_t value_
The value.
boost::flyweight< std::string, boost::flyweights::no_tracking, boost::flyweights::intermodule_holder > symbol
An internalized string.
To dyn_cast(From &&from)
A dynamic_cast in debug mode, static_cast with NDEBUG.
context join(const context &c1, const context &c2)
Bridge.
const value_impl * operator->() const
symbol vname() const
A description of the value type.
Tag for expansion/expansionset.
auto & as()
Extract wrapped typed value.
Abstract wrapped typed Value/ValueSet.
model(valueset_t vs, value_t v)
const auto & as() const
Extract wrapped typed value.
std::shared_ptr< base > self_
The wrapped value/valueset.
const valueset_t valueset_
The value set.
Provide a variadic mul on top of a binary mul(), and one().
value_impl()
Default construction: empty.
Tag for weight/weightset.
Tag for expression/expressionset.
A wrapped typed Value/ValueSet.
Tag for polynomial/polynomialset.
const value_t value() const