Skip to content

Commit

Permalink
BREAKING! rename default_context::transaction to default_context::def…
Browse files Browse the repository at this point in the history
…ault_transaction

`transaction _;` won't longer be ambiguous when both `ureact` and `ureact::default_context` namespaces are used
  • Loading branch information
YarikTH committed Jul 29, 2023
1 parent 3f1ae5e commit 16bb76b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/ureact/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ namespace default_context
* @brief Guard class to perform several changes atomically
*
*/
struct UREACT_WARN_UNUSED_RESULT transaction : ureact::transaction
struct UREACT_WARN_UNUSED_RESULT default_transaction : ureact::transaction
{
transaction()
default_transaction()
: ureact::transaction( default_context::get() )
{}
};
Expand All @@ -101,7 +101,7 @@ template <typename F,
class = std::enable_if_t<std::is_invocable_v<F&&, Args&&...>>>
UREACT_WARN_UNUSED_RESULT auto do_transaction( F&& func, Args&&... args )
{
default_context::transaction _;
default_transaction _;

if constexpr( std::is_same_v<std::invoke_result_t<F&&, Args&&...>, void> )
{
Expand Down
2 changes: 1 addition & 1 deletion tests/src/feature/default_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST_CASE( "ureact::default_context (transactions)" )

SECTION( "transaction" )
{
transaction _;
default_transaction _;
src <<= 2;
src <<= 1;
src <<= 4;
Expand Down

0 comments on commit 16bb76b

Please sign in to comment.