From 101412c3f9eb9551225088c58dbfc55b0bc96c33 Mon Sep 17 00:00:00 2001 From: Myun2 Date: Tue, 21 Sep 2010 00:41:44 +0900 Subject: [PATCH] =?utf8?q?static=5Fmap.hpp:=20=E3=81=86=E3=83=BC=E3=82=93?= =?utf8?q?=E3=80=82=E3=81=93=E3=82=8C=E3=81=A0=E3=81=A8=E3=82=B3=E3=83=B3?= =?utf8?q?=E3=83=91=E3=82=A4=E3=83=AB=E9=80=9A=E3=82=8B=E3=82=93=E3=81=A0?= =?utf8?q?=E3=81=91=E3=81=A9=E3=81=AD=E3=81=87=E3=83=BB=E3=83=BB=E3=83=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- roast/include/roast/tp/static_map.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/roast/include/roast/tp/static_map.hpp b/roast/include/roast/tp/static_map.hpp index 87247c78..9265f50c 100644 --- a/roast/include/roast/tp/static_map.hpp +++ b/roast/include/roast/tp/static_map.hpp @@ -18,8 +18,8 @@ namespace roast //typedef unitype_tuple<_KvPair, _Count> _Array; typedef typename _unitype_tuple_t<_KvPair, _Count>::type _Array; protected: - const _Array m_array; - //enum { _get_last = _Count -1 }; + _Array m_array; + enum { _get_last = _Count }; private: ////////////////////////////////////////////////////////////////////////////////// @@ -28,39 +28,39 @@ namespace roast class _get { private: - const _Array m_array; + _Array m_array; _Val _get_sub(){ _get<_TargetIndex, _SearchingIndex+1> o(m_array); return o(); } public: - _get(const _Array& v) : m_array(v) {} + _get(_Array& v) : m_array(v) {} _Val operator()(){ - return ( m_array.get<_SearchingIndex>().first == k ? + return ( m_array.get<_SearchingIndex>().first == _TargetIndex ? m_array.get<_SearchingIndex>().second : _get_sub() ); } }; template - class _get<_TargetIndex,_Count> + class _get<_TargetIndex,3> { public: _get(const _Array& v){} - _Val operator()(){} + _Val operator()(){ return _Val(); } }; ////////////////////////////////////////////////////////////////////////////////// public: - static_map(const _Array& v) : m_array(v) {} + static_map(_Array& v) : m_array(v) {} ////////////////////////////////////////////////////////////////// template - _Val get(){ _get<_TargetIndex,0> o(m_array); return o(); } + _Val get(){ _get<_TargetIndex,1> o(m_array); return o(); } //_Val::value_type operator [] (_Key k){ } }; } -- 2.11.0