X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Futils.hpp;h=326f0ae746396312e235d105af4a8c4b8fe66011;hb=9caec246ae3fabcadd56c334e9b8755ccf8c46c0;hp=990bad57517bf33031c059fe667be5075318e19d;hpb=767954d25dee78ad2c5ccfc1ee40a5dbb157ca21;p=lttng-tools.git diff --git a/src/bin/lttng/utils.hpp b/src/bin/lttng/utils.hpp index 990bad575..326f0ae74 100644 --- a/src/bin/lttng/utils.hpp +++ b/src/bin/lttng/utils.hpp @@ -26,13 +26,19 @@ extern pid_t sessiond_pid; struct cmd_struct; struct session_spec { - enum type { + enum class type { NAME, GLOB_PATTERN, ALL, }; - type type; + explicit session_spec(type spec_type, const char *name_or_pattern = nullptr) noexcept : + type_(spec_type), value(name_or_pattern) + { + } + + /* Disambiguate type enum from the member for buggy g++ versions. */ + type type_; const char *value; }; @@ -41,11 +47,9 @@ struct session_spec { */ class session_list { template - class _iterator - : public std::iterator { + class _iterator : public std::iterator { public: - explicit _iterator(ContainerType& list, std::size_t k) : - _list(list), _index(k) + explicit _iterator(ContainerType& list, std::size_t k) : _list(list), _index(k) { }