Skip to content

Commit

Permalink
Explicitly retrieving value of DecrementIsNoExcept() as a workaround …
Browse files Browse the repository at this point in the history
…for a bug in VS2017 where the DecremenIsNoExcept() may return void.

This is possibly related to use of noexcept expresions on destructors.

(Internal change: 2319827)
  • Loading branch information
pixar-oss committed Mar 11, 2024
1 parent ca4480e commit 6686384
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pxr/base/tf/delegatedCountPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,10 @@ class TfDelegatedCountPtr {
}

/// Call `TfDelegatedCountDecrement` on the held pointer if it is not
/// `nullptr`.
~TfDelegatedCountPtr() noexcept(DecrementIsNoExcept()) {
/// nullptr`. A bug occurs in VS2017 where calling DecrementIsNoExcept()
/// may return void. The bug is possibly related to an issue with using
/// noexcept expressions in destructors.
~TfDelegatedCountPtr() noexcept(DecrementIsNoExcept::value) {
_DecrementIfValid();
}

Expand Down

0 comments on commit 6686384

Please sign in to comment.