Skip to content

Commit f22f9ec

Browse files
committed
Add operator overload to check for equality
1 parent c775d8f commit f22f9ec

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

sdk/include/opentelemetry/sdk/trace/tracer_config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class TracerConfig
2828
* @return a boolean indicating if the Tracer is enabled. Defaults to true.
2929
*/
3030
bool IsEnabled() const noexcept;
31+
bool operator==(const TracerConfig& other) const noexcept;
3132

3233
static TracerConfig Disabled();
3334
static TracerConfig Enabled();

sdk/src/trace/tracer_config.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ bool TracerConfig::IsEnabled() const noexcept
4040
{
4141
return !disabled_;
4242
}
43+
44+
bool TracerConfig::operator==(const TracerConfig &other) const noexcept
45+
{
46+
return disabled_ == other.disabled_;
47+
}
48+
4349
} // namespace trace
4450
} // namespace sdk
4551
OPENTELEMETRY_END_NAMESPACE

0 commit comments

Comments
 (0)