Vcsn  2.4
Be Rational
project-context.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vcsn/ctx/context.hh>
5 
6 namespace vcsn
7 {
8 
9  /*--------------------.
10  | project(context). |
11  `--------------------*/
12 
13  namespace detail
14  {
16  template <size_t Tape,
17  typename LabelSet, typename WeightSet>
19  -> std::enable_if_t<is_multitape<LabelSet>{},
20  project_context<Tape, context<LabelSet, WeightSet>>>
21  {
22  // FIXME: The following assert works only for tupleset. Handle
23  // the case of expressionset.
24  //
25  // static_assert(Tape < LabelSet::size(),
26  // "project: tape index out of bounds");
27  return {ctx.labelset()->template project<Tape>(), *ctx.weightset()};
28  }
29 
32  template <size_t Tape,
33  typename LabelSet, typename WeightSet>
35  -> std::enable_if_t<!is_multitape<LabelSet>{},
37  {
38  static_assert(Tape == 0,
39  "project: cannot extract non-0 tape from a non tupleset"
40  " labelset");
41  return ctx;
42  }
43  }
44 }
Definition: a-star.hh:8
auto project(const expressionset< Context > &rs)
Project an expressionset to one tape.
Definition: project.hh:40