From 2c8091dfcfe888766a64254ad1119adcfdfd5542 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Tue, 21 Sep 2010 00:58:34 +0900 Subject: [PATCH] =?utf8?q?static=5Fmap.hpp:=20=E3=81=BE=E3=81=81example?= =?utf8?q?=E5=85=A5=E3=82=8C=E3=81=A8=E3=81=8F=E3=81=B9=E3=83=BC=E3=81=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/tp/static_map.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/roast/include/roast/tp/static_map.hpp b/roast/include/roast/tp/static_map.hpp index c2ba4402..9d3c1b00 100644 --- a/roast/include/roast/tp/static_map.hpp +++ b/roast/include/roast/tp/static_map.hpp @@ -9,7 +9,16 @@ namespace roast { - template + /* + example: + + using namespace std; + using namespace roast; + static_map sm( make_ul_tuple( make_pair(1,"hoge"), make_pair(4,"huge"), make_pair(6,"hige") ) ); + printf("%s\n", sm.get<4>() ); // output "huge". + + */ + template class static_map { public: @@ -59,7 +68,10 @@ namespace roast ////////////////////////////////////////////////////////////////// template - _Val get(){ _get<_TargetIndex,_Count> o(m_array); return o(); } + _Val get(){ + _get<_TargetIndex,_Count> o(m_array); + return o(); + } //_Val::value_type operator [] (_Key k){ } }; } -- 2.11.0