IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 5699ccfc authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Alan Coleman
Browse files

change return type of get_nucleus_name() to std::string

parent 17924bb8
No related branches found
No related tags found
1 merge request!463Resolve "get_nucleus_name() returns string_view to temporary object"
Pipeline #9644 passed
...@@ -147,7 +147,7 @@ namespace corsika { ...@@ -147,7 +147,7 @@ namespace corsika {
return get_mass(Code::Proton) * Z + (A - Z) * get_mass(Code::Neutron); return get_mass(Code::Proton) * Z + (A - Z) * get_mass(Code::Neutron);
} }
inline std::string_view get_nucleus_name(Code const code) { inline std::string get_nucleus_name(Code const code) {
size_t const A = get_nucleus_A(code); size_t const A = get_nucleus_A(code);
size_t const Z = get_nucleus_Z(code); size_t const Z = get_nucleus_Z(code);
return fmt::format("Nucleus_A{}_Z{}", A, Z); return fmt::format("Nucleus_A{}_Z{}", A, Z);
......
...@@ -207,7 +207,7 @@ namespace corsika { ...@@ -207,7 +207,7 @@ namespace corsika {
* @param code * @param code
* @return std::string_view * @return std::string_view
*/ */
inline std::string_view get_nucleus_name(Code const code); inline std::string get_nucleus_name(Code const code);
/** /**
* @brief convert PDG code to CORSIKA 8 internal code. * @brief convert PDG code to CORSIKA 8 internal code.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment