Vcsn  2.2a
Be Rational
cast.hh
Go to the documentation of this file.
1 #pragma once
2 
3 namespace vcsn
4 {
5  namespace dyn
6  {
7  namespace detail
8  {
10  template <typename To, typename From>
11  inline
12  To dyn_cast(From&& from)
13  {
14 #ifdef NDEBUG
15  return static_cast<To>(std::forward<From>(from));
16 #else
17  return dynamic_cast<To>(std::forward<From>(from));
18 #endif
19  }
20  }
21  }
22 }
To dyn_cast(From &&from)
A dynamic_cast in debug mode, static_cast with NDEBUG.
Definition: cast.hh:12
Definition: a-star.hh:8