From cf0cad0951699a14ddff54f7c1064d7b45c7af41 Mon Sep 17 00:00:00 2001 From: Jerry Quinn Date: Tue, 1 Jul 2003 02:55:20 +0000 Subject: [PATCH] locale.cc (__use_cache): Move from here ... 2003-06-27 Jerry Quinn * src/locale.cc (__use_cache): Move from here ... * include/bits/locale_facets.tcc (__use_cache): To here. From-SVN: r68756 --- libstdc++-v3/ChangeLog | 6 ++++ libstdc++-v3/include/bits/locale_facets.tcc | 30 ++++++++++++++++--- libstdc++-v3/src/locale.cc | 32 --------------------- 3 files changed, 32 insertions(+), 36 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 731de3114b2..7b5eea6d247 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2003-06-27 Jerry Quinn + + * src/locale.cc (__use_cache): Move from here ... + * include/bits/locale_facets.tcc (__use_cache): To + here. + 2003-06-30 Paolo Carlini * include/bits/stl_algobase.h: Fully qualify standard diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index aca0e056d67..6a3881652d2 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -93,13 +93,35 @@ namespace std __use_cache(const locale& __loc); template<> - const __numpunct_cache& - __use_cache(const locale& __loc); + inline const __numpunct_cache& + __use_cache(const locale& __loc) + { + size_t __i = numpunct::id._M_id(); + const locale::facet** __caches = __loc._M_impl->_M_caches; + if (!__caches[__i]) + { + __numpunct_cache* __tmp = new __numpunct_cache; + __tmp->_M_cache(__loc); + __loc._M_impl->_M_install_cache(__tmp, __i); + } + return static_cast&>(*__caches[__i]); + } #ifdef _GLIBCPP_USE_WCHAR_T template<> - const __numpunct_cache& - __use_cache(const locale& __loc); + inline const __numpunct_cache& + __use_cache(const locale& __loc) + { + size_t __i = numpunct::id._M_id(); + const locale::facet** __caches = __loc._M_impl->_M_caches; + if (!__caches[__i]) + { + __numpunct_cache* __tmp = new __numpunct_cache; + __tmp->_M_cache(__loc); + __loc._M_impl->_M_install_cache(__tmp, __i); + } + return static_cast&>(*__caches[__i]); + } #endif // Stage 1: Determine a conversion specifier. diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index 7788a58419d..8cb89e56772 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -449,38 +449,6 @@ namespace std locale::facet:: ~facet() { } - template<> - const __numpunct_cache& - __use_cache(const locale& __loc) - { - size_t __i = numpunct::id._M_id(); - const locale::facet** __caches = __loc._M_impl->_M_caches; - if (!__caches[__i]) - { - __numpunct_cache* __tmp = new __numpunct_cache; - __tmp->_M_cache(__loc); - __loc._M_impl->_M_install_cache(__tmp, __i); - } - return static_cast&>(*__caches[__i]); - } - -#ifdef _GLIBCPP_USE_WCHAR_T - template<> - const __numpunct_cache& - __use_cache(const locale& __loc) - { - size_t __i = numpunct::id._M_id(); - const locale::facet** __caches = __loc._M_impl->_M_caches; - if (!__caches[__i]) - { - __numpunct_cache* __tmp = new __numpunct_cache; - __tmp->_M_cache(__loc); - __loc._M_impl->_M_install_cache(__tmp, __i); - } - return static_cast&>(*__caches[__i]); - } -#endif - // Definitions for static const data members of time_base template<> const char* -- 2.30.2