|
Lines 96-101
class G4String : public std::string
Link Here
|
| 96 |
/// to match the `std::string` interface. |
96 |
/// to match the `std::string` interface. |
| 97 |
inline operator const char*() const; |
97 |
inline operator const char*() const; |
| 98 |
|
98 |
|
|
|
99 |
/// @brief Override of subscript operator for `int` to suppress C2666 errors with MSVC |
| 100 |
/// @deprecated Will be removed at the same time as `operator const char*` that requires it |
| 101 |
/// |
| 102 |
/// This override is required because of G4String's provision of an implicit conversion |
| 103 |
/// operator to `const char*`. Together with the subscript operator and C++'s built-in |
| 104 |
/// `operator[](const char*, int) operator, use of G4String::operator[] will trigger |
| 105 |
/// [MSVC error C2666](https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c2666?view=msvc-170) |
| 106 |
/// This is a known issue with mixing implicit conversion to `const char*` and subscript |
| 107 |
/// operators. Provision of the override with `int` argument is thus a workaround |
| 108 |
/// until the conversion operator is removed. |
| 109 |
inline reference operator[](int); |
| 110 |
|
| 111 |
/// @overload |
| 112 |
inline const_reference operator[](int) const; |
| 113 |
|
| 99 |
/// @brief Deprecated function |
114 |
/// @brief Deprecated function |
| 100 |
/// @deprecated Use `std::string::compare` or `G4StrUtil::icompare` instead |
115 |
/// @deprecated Use `std::string::compare` or `G4StrUtil::icompare` instead |
| 101 |
[[deprecated("Use std::string::compare, or G4StrUtil::icompare for case-insensitive comparison")]] |
116 |
[[deprecated("Use std::string::compare, or G4StrUtil::icompare for case-insensitive comparison")]] |