Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make Variant constructor explicit #370

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ v2.x
what before had to be obtained through `PollData::getAbsoluteTimeout()` call.
- `PollData::getRelativeTimeout()` return type was changed to `std::chrono::microseconds`.
- `IConnection::processPendingRequest()` was renamed to `IConnection::processPendingEvent()`.
- `Variant` constructor is now explicit.
- Systemd of at least v238 is required to compile sdbus-c++
- A proper fix for timeout handling
- Fix for external event loops in which the event loop thread ID was not correctly initialized (now fixed and simplified by not needing the thread ID anymore)
Expand Down
2 changes: 1 addition & 1 deletion include/sdbus-c++/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace sdbus {
Variant();

template <typename _ValueType>
/*explicit*/ Variant(const _ValueType& value) // TODO: Mark explicit in new major version so we don't break client code within v1
explicit Variant(const _ValueType& value)
: Variant()
{
msg_.openVariant(signature_of<_ValueType>::str());
Expand Down
1 change: 0 additions & 1 deletion tests/integrationtests/DBusSignalsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ TYPED_TEST(SdbusTestObject, EmitsSignalWithVariantSuccesfully)
{
double d = 3.14;
this->m_adaptor->emitSignalWithVariant(sdbus::Variant{d});
this->m_adaptor->emitSignalWithVariant(d);

ASSERT_TRUE(waitUntil(this->m_proxy->m_gotSignalWithVariant));
ASSERT_THAT(this->m_proxy->m_variantFromSignal, DoubleEq(d));
Expand Down