@@ -440,23 +440,13 @@ namespace mamba::util
440
440
/* * Locks (shared if possible) and compare equality of the stored object's value with the
441
441
provided value.
442
442
*/
443
- auto operator ==(const std::equality_comparable_with<T> auto & other_value) const -> bool
444
- {
445
- auto _ = lock_as_readonly (m_mutex);
446
- return m_value == other_value;
447
- }
443
+ auto operator ==(const std::equality_comparable_with<T> auto & other_value) const -> bool ;
448
444
449
- /* * Locks (shared if possible) and compare equality of the stored object's value with the
445
+ /* * Locks both (shared if possible) and compare equality of the stored object's value with the
450
446
provided value.
451
447
*/
452
448
template <std::equality_comparable_with<T> U, Mutex OtherMutex>
453
- auto operator ==(const synchronized_value<U, OtherMutex>& other_value) const -> bool
454
- {
455
- auto this_lock [[maybe_unused]] = lock_as_readonly (m_mutex);
456
- auto other_lock [[maybe_unused]] = lock_as_readonly (other_value.m_mutex );
457
-
458
- return m_value == other_value.m_value ;
459
- }
449
+ auto operator ==(const synchronized_value<U, OtherMutex>& other_value) const -> bool ;
460
450
461
451
auto swap (synchronized_value& other) -> void;
462
452
auto swap (T& value) -> void;
@@ -568,6 +558,26 @@ namespace mamba::util
568
558
return std::invoke (std::forward<Func>(func), std::as_const (m_value), std::forward<Args>(args)...);
569
559
}
570
560
561
+ template <std::default_initializable T, Mutex M>
562
+ auto synchronized_value<T, M>::operator ==(const std::equality_comparable_with<T> auto & other_value
563
+ ) const -> bool
564
+ {
565
+ auto _ = lock_as_readonly (m_mutex);
566
+ return m_value == other_value;
567
+ }
568
+
569
+ template <std::default_initializable T, Mutex M>
570
+ template <std::equality_comparable_with<T> U, Mutex OtherMutex>
571
+ auto
572
+ synchronized_value<T, M>::operator ==(const synchronized_value<U, OtherMutex>& other_value) const
573
+ -> bool
574
+ {
575
+ auto this_lock [[maybe_unused]] = lock_as_readonly (m_mutex);
576
+ auto other_lock [[maybe_unused]] = lock_as_readonly (other_value.m_mutex );
577
+
578
+ return m_value == other_value.m_value ;
579
+ }
580
+
571
581
template <std::default_initializable T, Mutex M>
572
582
auto synchronized_value<T, M>::swap(synchronized_value& other) -> void
573
583
{
0 commit comments