Vcsn  2.4
Be Rational
strip.hh
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vcsn/dyn/automaton.hh>
4 
5 namespace vcsn
6 {
7  namespace detail
8  {
9  // Rely on the fact that int takes precedence over long to express
10  // a precedence of this first function over the second one.
11 
12  // automata that feature a strip member function.
13  template <Automaton Aut>
14  auto
15  strip(const Aut& aut, int)
16  -> decltype(aut->strip())
17  {
18  return aut->strip();
19  }
20 
21  // automata that don't feature a strip member function.
22  template <Automaton Aut>
23  auto
24  strip(const Aut& aut, long)
25  -> decltype(aut)
26  {
27  return aut;
28  }
29  }
30 
32  template <Automaton Aut>
33  auto
34  strip(const Aut& aut)
35  {
36  return detail::strip(aut, 0);
37  }
38 
39  namespace dyn
40  {
41  namespace detail
42  {
44  template <Automaton Aut>
45  automaton
46  strip(const automaton& aut)
47  {
48  const auto& a = aut->as<Aut>();
50  }
51  }
52  }
53 } // vcsn::
auto strip(const Aut &aut, int) -> decltype(aut->strip())
Definition: strip.hh:15
Definition: a-star.hh:8
A dyn automaton.
Definition: automaton.hh:17
auto strip(const Aut &aut)
Remove (all) the decorations from a decorated automaton.
Definition: strip.hh:34
auto & as()
Extract wrapped typed automaton.
Definition: automaton.hh:37
automaton strip(const automaton &aut)
Bridge.
Definition: strip.hh:46