Vcsn  2.3
Be Rational
constant.hh
Go to the documentation of this file.
1 #pragma once
2 
4 #include <vcsn/dyn/context.hh>
5 #include <vcsn/dyn/value.hh>
6 
7 namespace vcsn
8 {
9  namespace dyn
10  {
11  namespace detail
12  {
14  template <typename Context, typename Identities>
15  expression expression_one(const context& ctx, identities ids)
16  {
17  const auto& c = ctx->as<Context>();
18  auto rs = vcsn::make_expressionset(c, ids);
19  return {rs, rs.one()};
20  }
21 
23  template <typename Context, typename Identities>
25  {
26  const auto& c = ctx->as<Context>();
27  auto rs = vcsn::make_expressionset(c, ids);
28  return {rs, rs.zero()};
29  }
30  }
31  }
32 } // namespace vcsn
auto & as()
Downcast to the exact type.
Definition: context.hh:36
expression expression_one(const context &ctx, identities ids)
Bridge.
Definition: constant.hh:15
expression expression_zero(const context &ctx, identities ids)
Bridge.
Definition: constant.hh:24
Template-less root for contexts.
Definition: context.hh:16
auto rs
Definition: lift.hh:152
Definition: a-star.hh:8
auto make_expressionset(const context< LabelSet, WeightSet > &ctx, rat::identities ids={}) -> expressionset< context< LabelSet, WeightSet >>
Shorthand to expressionset constructor.
static identities ids(const driver &d)
Get the identities of the driver.
Definition: parse.cc:89
value_impl< detail::expression_tag > expression
Definition: fwd.hh:25