Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
#ifndef GENERS_INT2TYPE_HH_
#define GENERS_INT2TYPE_HH_

#include <sstream>

namespace gs {
  namespace Private {
    inline std::string makeInt2TypeStage(const int v) {
      std::ostringstream os;
      os << "Int2Type::" << v;
      return os.str();
    }
  }  // namespace Private

  template <int v>
  struct Int2Type {
    enum { value = v };

    static const char *stage() {
      static const std::string buf(Private::makeInt2TypeStage(v));
      return buf.c_str();
    }
  };
}  // namespace gs

#endif  // GENERS_INT2TYPE_HH_