|
|
|
Back
Midas
Rome
Roody
Rootana
|
| Midas DAQ System |
Not logged in |
 |
|
26 Nov 2025, Lars Martin, Suggestion, mvodb WS and family type matching
|
27 Nov 2025, Konstantin Olchanski, Suggestion, mvodb WS and family type matching
|
27 Nov 2025, Stefan Ritt, Suggestion, mvodb WS and family type matching
|
28 Nov 2025, Konstantin Olchanski, Suggestion, mvodb WS and family type matching
|
28 Nov 2025, Konstantin Olchanski, Suggestion, mvodb WS and family type matching
|
|
|
Message ID: 3160
Entry time: 28 Nov 2025
In reply to: 3159
|
| Author: |
Konstantin Olchanski |
| Topic: |
Suggestion |
| Subject: |
mvodb WS and family type matching |
|
|
Just in time, enter std::string_view.
https://stackoverflow.com/questions/40127965/how-exactly-is-stdstring-view-faster-than-const-stdstring
I was looking at https://root.cern/doc/v638/classROOT_1_1Experimental_1_1RFile.html and they use it everywhere instead of
std::string and const char*.
(so now we have 4 string types to deal with, counting ROOT's TString).
P.S. For extra safety, this code compiles, then explodes:
std::string_view get_temporary_string() {
std::string s = "temporary";
return s; // DANGER! 's' is destroyed, view dangles.
}
K.O. |