Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2017-03-06 22:22:38 +0300
committerKacper Michajłow <kasper93@gmail.com>2017-03-07 00:57:28 +0300
commit11a263c1f4f8278c973b61b31351f891e48ec737 (patch)
tree10c9fd751bf484b8b60a8a8e7bb0f139d065f180
parent58c5813b7e831e6e1dacd601a8bb9913d8f2923f (diff)
ISOLang: Make languages array constant.
-rw-r--r--src/DSUtil/ISOLang.cpp4
-rw-r--r--src/DSUtil/ISOLang.h15
2 files changed, 6 insertions, 13 deletions
diff --git a/src/DSUtil/ISOLang.cpp b/src/DSUtil/ISOLang.cpp
index 46dc28442..a324602f8 100644
--- a/src/DSUtil/ISOLang.cpp
+++ b/src/DSUtil/ISOLang.cpp
@@ -1,5 +1,5 @@
/*
- * (C) 2016 see Authors.txt
+ * (C) 2016-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -25,7 +25,7 @@
namespace
{
- ISOLang s_isolangs[] = { // TODO : fill LCID !!!
+ constexpr ISOLang s_isolangs[] = { // TODO : fill LCID !!!
// {"Auxiliary Language Association)", "", ""},
// {"English-based (Other)", "", ""},
// {"French-based (Other)", "", ""},
diff --git a/src/DSUtil/ISOLang.h b/src/DSUtil/ISOLang.h
index 5fb3fd2f2..6c701575c 100644
--- a/src/DSUtil/ISOLang.h
+++ b/src/DSUtil/ISOLang.h
@@ -1,5 +1,5 @@
/*
- * (C) 2016 see Authors.txt
+ * (C) 2016-2017 see Authors.txt
*
* This file is part of MPC-HC.
*
@@ -27,24 +27,17 @@ struct ISOLangT {
StringType name, iso6392, iso6391;
LCID lcid;
- ISOLangT(StringType name = nullptr, StringType iso6392 = nullptr, StringType iso6391 = nullptr, LCID lcid = 0)
+ constexpr ISOLangT(StringType name = nullptr, StringType iso6392 = nullptr, StringType iso6391 = nullptr, LCID lcid = 0)
: name(name), iso6392(iso6392), iso6391(iso6391), lcid(lcid)
{};
template<typename StringType2>
- ISOLangT(const ISOLangT<StringType2>& isoLang)
+ constexpr ISOLangT(const ISOLangT<StringType2>& isoLang)
: name(isoLang.name), iso6392(isoLang.iso6392), iso6391(isoLang.iso6391), lcid(isoLang.lcid)
{};
template<typename StringType2>
- ISOLangT& operator=(const ISOLangT<StringType2>& isoLang) {
- name = isoLang.name;
- iso6392 = isoLang.iso6392;
- iso6391 = isoLang.iso6391;
- lcid = isoLang.lcid;
-
- return *this;
- };
+ ISOLangT& operator=(const ISOLangT<StringType2>& isoLang) = delete;
};
struct ISOLang : public ISOLangT<LPCSTR> {