Commit df051627 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

tgba_digraph: Simplify declaration of forwarded methods.

* src/misc/common.hh (SPOT_RETURN): New macro.
* src/tgba/tgbagraph.hh (out, states, transitions): Use it.
parent 6ecd71c4
......@@ -95,4 +95,9 @@
#define SPOT_UNIMPLEMENTED() throw std::runtime_error("unimplemented");
// Useful when forwarding methods such as:
// auto func(int param) SPOT_RETURN(implem_.func(param));
#define SPOT_RETURN(code) -> decltype(code) { return code; }
#endif // SPOT_MISC_COMMON_HH
......@@ -332,17 +332,20 @@ namespace spot
return g_.new_transition(src, dst, cond, acc);
}
internal::state_out<const graph_t>
out(unsigned src) const
{
return g_.out(src);
}
internal::state_out<graph_t>
out(unsigned src)
{
return g_.out(src);
}
auto out(unsigned src) const
SPOT_RETURN(g_.out(src));
auto out(unsigned src)
SPOT_RETURN(g_.out(src));
auto states() const
SPOT_RETURN(g_.states());
auto states()
SPOT_RETURN(g_.states());
auto transitions() const
SPOT_RETURN(g_.transitions());
auto transitions()
SPOT_RETURN(g_.transitions());
/// \brief Copy the acceptance conditions of another tgba.
void copy_acceptance_conditions_of(const tgba *a)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment