summaryrefslogtreecommitdiff
path: root/xsd/xsd
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-09-05 15:20:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-09-06 11:44:16 +0300
commit28f737a15d9ce5d9e8b06ab768ef858c07ae510e (patch)
tree7523a801d1326a6e8ba0646d8d4b927f1eaa608b /xsd/xsd
parent0c40310afde1d595697d0edfb3b174a9738605cf (diff)
Make c++11 value default for xsd --std option
Also add support for c++14, c++17, c++20, and c++23 values and drop passing --std option in tests and examples.
Diffstat (limited to 'xsd/xsd')
-rw-r--r--xsd/xsd/cxx/option-types.cxx14
-rw-r--r--xsd/xsd/cxx/option-types.hxx8
-rw-r--r--xsd/xsd/cxx/options.cli8
-rw-r--r--xsd/xsd/pregenerated/xsd/cxx/options.cxx2
4 files changed, 25 insertions, 7 deletions
diff --git a/xsd/xsd/cxx/option-types.cxx b/xsd/xsd/cxx/option-types.cxx
index ad8a3c9..8744d7f 100644
--- a/xsd/xsd/cxx/option-types.cxx
+++ b/xsd/xsd/cxx/option-types.cxx
@@ -17,7 +17,11 @@ namespace CXX
static const char* cxx_version_[] =
{
"c++98",
- "c++11"
+ "c++11",
+ "c++14",
+ "c++17",
+ "c++20",
+ "c++23",
};
string cxx_version::
@@ -38,6 +42,14 @@ namespace CXX
v = cxx_version::cxx98;
else if (s == "c++11")
v = cxx_version::cxx11;
+ else if (s == "c++14")
+ v = cxx_version::cxx14;
+ else if (s == "c++17")
+ v = cxx_version::cxx17;
+ else if (s == "c++20")
+ v = cxx_version::cxx20;
+ else if (s == "c++23")
+ v = cxx_version::cxx23;
else
is.setstate (istream::failbit);
}
diff --git a/xsd/xsd/cxx/option-types.hxx b/xsd/xsd/cxx/option-types.hxx
index bbb15b3..98a493a 100644
--- a/xsd/xsd/cxx/option-types.hxx
+++ b/xsd/xsd/cxx/option-types.hxx
@@ -14,10 +14,14 @@ namespace CXX
enum value
{
cxx98,
- cxx11
+ cxx11,
+ cxx14,
+ cxx17,
+ cxx20,
+ cxx23
};
- cxx_version (value v = value (0)) : v_ (v) {}
+ cxx_version (value v) : v_ (v) {}
operator value () const {return v_;}
std::string
diff --git a/xsd/xsd/cxx/options.cli b/xsd/xsd/cxx/options.cli
index 2c50f19..1eb1b61 100644
--- a/xsd/xsd/cxx/options.cli
+++ b/xsd/xsd/cxx/options.cli
@@ -15,17 +15,19 @@ namespace CXX
{
// Language.
//
- cxx_version --std = cxx_version::cxx98
+ cxx_version --std = cxx_version::cxx11
{
"<version>",
"Specify the C++ standard that the generated code should conform to.
- Valid values are \cb{c++98} (default) and \cb{c++11}.
+ Valid values are \cb{c++98}, \cb{c++11} (default), \cb{c++14},
+ \cb{c++17}, \cb{c++20}, and \cb{c++23}.
The C++ standard affects various aspects of the generated code that
are discussed in more detail in various mapping-specific
documentation. Overall, when C++11 is selected, the generated
code relies on the move semantics and uses \cb{std::unique_ptr}
- instead of deprecated \cb{std::auto_ptr}.
+ instead of deprecated \cb{std::auto_ptr}. Currently, there is no
+ difference between the C++11 and the later standards modes.
When the C++11 mode is selected, you normally don't need to
perform any extra steps other than enable C++11 in your C++
diff --git a/xsd/xsd/pregenerated/xsd/cxx/options.cxx b/xsd/xsd/pregenerated/xsd/cxx/options.cxx
index 24532f5..4d4fa23 100644
--- a/xsd/xsd/pregenerated/xsd/cxx/options.cxx
+++ b/xsd/xsd/pregenerated/xsd/cxx/options.cxx
@@ -266,7 +266,7 @@ namespace CXX
options::
options ()
- : std_ (cxx_version::cxx98),
+ : std_ (cxx_version::cxx11),
std_specified_ (false),
char_type_ ("char"),
char_type_specified_ (false),