/** ** \file misc/select-const.hh ** \brief Select between a non const or a const type. */ #pragma once namespace misc { /*------------------. | const selectors. | `------------------*/ /// Return \a T constified. template struct constify_traits { using type = const T; }; /// Return \a T as is. template struct id_traits { using type = T; }; /*------------------. | select_iterator. | `------------------*/ /// The iterator over a non const structure is plain iterator. template struct select_iterator { using type = typename T::iterator; }; /// The iterator over a const structure is a const_iterator. template struct select_iterator { using type = typename T::const_iterator; }; } //namespace misc