From 9c1142c88061ed357b8f15bc151707a07303f3ea Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Thu, 24 Nov 2016 00:30:13 +0100 Subject: [PATCH] Remove unneeded templatization code from bformat(). --- src/support/lstrings.cpp | 24 ++++++------------------ src/support/lstrings.h | 37 ++++++++++++------------------------- 2 files changed, 18 insertions(+), 43 deletions(-) diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp index 9eb9e43d5f..0dd8075e03 100644 --- a/src/support/lstrings.cpp +++ b/src/support/lstrings.cpp @@ -1408,7 +1408,6 @@ std::string formatFPNumber(double x) } -template<> docstring bformat(docstring const & fmt, int arg1) { LATTEST(contains(fmt, from_ascii("%1$d"))); @@ -1417,7 +1416,6 @@ docstring bformat(docstring const & fmt, int arg1) } -template<> docstring bformat(docstring const & fmt, long arg1) { LATTEST(contains(fmt, from_ascii("%1$d"))); @@ -1427,7 +1425,6 @@ docstring bformat(docstring const & fmt, long arg1) #ifdef LYX_USE_LONG_LONG -template<> docstring bformat(docstring const & fmt, long long arg1) { LATTEST(contains(fmt, from_ascii("%1$d"))); @@ -1437,7 +1434,6 @@ docstring bformat(docstring const & fmt, long long arg1) #endif -template<> docstring bformat(docstring const & fmt, unsigned int arg1) { LATTEST(contains(fmt, from_ascii("%1$d"))); @@ -1446,8 +1442,7 @@ docstring bformat(docstring const & fmt, unsigned int arg1) } -template<> -docstring bformat(docstring const & fmt, docstring arg1) +docstring bformat(docstring const & fmt, docstring const & arg1) { LATTEST(contains(fmt, from_ascii("%1$s"))); docstring const str = subst(fmt, from_ascii("%1$s"), arg1); @@ -1455,7 +1450,6 @@ docstring bformat(docstring const & fmt, docstring arg1) } -template<> docstring bformat(docstring const & fmt, char * arg1) { LATTEST(contains(fmt, from_ascii("%1$s"))); @@ -1464,8 +1458,7 @@ docstring bformat(docstring const & fmt, char * arg1) } -template<> -docstring bformat(docstring const & fmt, docstring arg1, docstring arg2) +docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2) { LATTEST(contains(fmt, from_ascii("%1$s"))); LATTEST(contains(fmt, from_ascii("%2$s"))); @@ -1475,8 +1468,7 @@ docstring bformat(docstring const & fmt, docstring arg1, docstring arg2) } -template<> -docstring bformat(docstring const & fmt, docstring arg1, int arg2) +docstring bformat(docstring const & fmt, docstring const & arg1, int arg2) { LATTEST(contains(fmt, from_ascii("%1$s"))); LATTEST(contains(fmt, from_ascii("%2$d"))); @@ -1486,8 +1478,7 @@ docstring bformat(docstring const & fmt, docstring arg1, int arg2) } -template<> -docstring bformat(docstring const & fmt, char const * arg1, docstring arg2) +docstring bformat(docstring const & fmt, char const * arg1, docstring const & arg2) { LATTEST(contains(fmt, from_ascii("%1$s"))); LATTEST(contains(fmt, from_ascii("%2$s"))); @@ -1497,7 +1488,6 @@ docstring bformat(docstring const & fmt, char const * arg1, docstring arg2) } -template<> docstring bformat(docstring const & fmt, int arg1, int arg2) { LATTEST(contains(fmt, from_ascii("%1$d"))); @@ -1508,8 +1498,7 @@ docstring bformat(docstring const & fmt, int arg1, int arg2) } -template<> -docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3) +docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2, docstring const & arg3) { LATTEST(contains(fmt, from_ascii("%1$s"))); LATTEST(contains(fmt, from_ascii("%2$s"))); @@ -1521,9 +1510,8 @@ docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstri } -template<> docstring bformat(docstring const & fmt, - docstring arg1, docstring arg2, docstring arg3, docstring arg4) + docstring const & arg1, docstring const & arg2, docstring const & arg3, docstring const & arg4) { LATTEST(contains(fmt, from_ascii("%1$s"))); LATTEST(contains(fmt, from_ascii("%2$s"))); diff --git a/src/support/lstrings.h b/src/support/lstrings.h index fa61414d1c..9719513513 100644 --- a/src/support/lstrings.h +++ b/src/support/lstrings.h @@ -345,33 +345,20 @@ int findToken(char const * const str[], std::string const & search_token); std::string formatFPNumber(double); -template -docstring bformat(docstring const & fmt, Arg1); - -template -docstring bformat(docstring const & fmt, Arg1, Arg2); - -template -docstring bformat(docstring const & fmt, Arg1, Arg2, Arg3); - -template -docstring bformat(docstring const & fmt, Arg1, Arg2, Arg3, Arg4); - - -template<> docstring bformat(docstring const & fmt, int arg1); -template<> docstring bformat(docstring const & fmt, long arg1); +docstring bformat(docstring const & fmt, int arg1); +docstring bformat(docstring const & fmt, long arg1); #ifdef LYX_USE_LONG_LONG -template<> docstring bformat(docstring const & fmt, long long arg1); +docstring bformat(docstring const & fmt, long long arg1); #endif -template<> docstring bformat(docstring const & fmt, unsigned int arg1); -template<> docstring bformat(docstring const & fmt, docstring arg1); -template<> docstring bformat(docstring const & fmt, char * arg1); -template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2); -template<> docstring bformat(docstring const & fmt, docstring arg1, int arg2); -template<> docstring bformat(docstring const & fmt, char const * arg1, docstring arg2); -template<> docstring bformat(docstring const & fmt, int arg1, int arg2); -template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3); -template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3, docstring arg4); +docstring bformat(docstring const & fmt, unsigned int arg1); +docstring bformat(docstring const & fmt, docstring const & arg1); +docstring bformat(docstring const & fmt, char * arg1); +docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2); +docstring bformat(docstring const & fmt, docstring const & arg1, int arg2); +docstring bformat(docstring const & fmt, char const * arg1, docstring const & arg2); +docstring bformat(docstring const & fmt, int arg1, int arg2); +docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2, docstring const & arg3); +docstring bformat(docstring const & fmt, docstring const & arg1, docstring const & arg2, docstring const & arg3, docstring const & arg4); } // namespace support