Skip to content
Snippets Groups Projects
Commit c3c186a8 authored by scott snyder's avatar scott snyder
Browse files

minor fixes

parent 7fa5168c
Branches
Tags
No related merge requests found
...@@ -2108,7 +2108,7 @@ public: ...@@ -2108,7 +2108,7 @@ public:
Experience has shown that exception specifications are generally not useful Experience has shown that exception specifications are generally not useful
and non-empty exception specifications are now an error [fn:Sutter02]. and non-empty exception specifications are now an error [fn:Sutter02].
They should not be used in new code. They should not be used in new code, and are not allowed in C++20.
There is also the keyword =noexcept=. The motivation for this was There is also the keyword =noexcept=. The motivation for this was
really to address a specific problem with move constructors and really to address a specific problem with move constructors and
...@@ -2246,29 +2246,6 @@ std::string aCPPString("Hello Atlas"); ...@@ -2246,29 +2246,6 @@ std::string aCPPString("Hello Atlas");
printf("This does not work: %s \n", aCPPString); printf("This does not work: %s \n", aCPPString);
//Core dump again //Core dump again
#+END_EXAMPLE #+END_EXAMPLE
#+BEGIN_COMMENT
Another example, from Control/StoreGateSvc.cxx:
#+BEGIN_EXAMPLE
#include <iostream>
#include <sstream>
..............
std::ostringstream ost;
..............
// loop over each type:
SG::ConstProxyIterator p_iter = (s_iter->second).begin();
SG::ConstProxyIterator p_end = (s_iter->second).end();
while (p_iter != p_end) {
const DataProxy& dp(*p_iter->second);
ost << " flags: ("
<< setw(7) << (dp.isValid() ? "valid" : "INVALID") << ", "
<< setw(8) << (dp.isConst() ? "locked" : "UNLOCKED") << ", "
<< setw(6) << (dp.isResetOnly() ? "reset" : "DELETE")
<< ") --- data: " << hex << setw(10) << dp.object() << dec
<< " --- key: " << p_iter->first << '\n';
++p_iter;
}
#+END_EXAMPLE
#+END_COMMENT
It is of course acceptable to use stdio functions if you're calling It is of course acceptable to use stdio functions if you're calling
an external library that requires them. an external library that requires them.
...@@ -2291,7 +2268,7 @@ void error(int severity, ...) // "severity" followed by a ...@@ -2291,7 +2268,7 @@ void error(int severity, ...) // "severity" followed by a
This method should be avoided. This method should be avoided.
As of C++ 11, one can accomplish something similar using varadic As of C++11, one can accomplish something similar using varadic
templates: templates:
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
...@@ -2604,7 +2581,6 @@ float ip_cut = 0.1 * Gaudi::Units::cm; ...@@ -2604,7 +2581,6 @@ float ip_cut = 0.1 * Gaudi::Units::cm;
may be found at [fn:Cxx20]. However, the standards documents are not may be found at [fn:Cxx20]. However, the standards documents are not
very readable. A better reference for most questions about what is in the very readable. A better reference for most questions about what is in the
standard is the cppreference.com website [fn:cppreference]. standard is the cppreference.com website [fn:cppreference].
At some point, compatibility with C++23 will also be required. At some point, compatibility with C++23 will also be required.
...@@ -2641,7 +2617,7 @@ float ip_cut = 0.1 * Gaudi::Units::cm; ...@@ -2641,7 +2617,7 @@ float ip_cut = 0.1 * Gaudi::Units::cm;
fail elsewhere. fail elsewhere.
The ATLAS convention is to include the package name followed by the file name. The ATLAS convention is to include the package name followed by the file name.
Watch out: list the package name twice is wrong, but some build systems Watch out: listing the package name twice is wrong, but some build systems
don't catch it. don't catch it.
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment