Skip to content

Commit 16fc795

Browse files
MSVC: are you even trying?
1 parent 858a9b0 commit 16fc795

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

thrust/thrust/optional.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,7 +1998,6 @@ _CCCL_HOST_DEVICE constexpr auto optional_map_impl(Opt&& opt, F&& f)
19981998
return opt.has_value() ? detail::invoke(std::forward<F>(f), *std::forward<Opt>(opt)) : optional<Ret>(nullopt);
19991999
}
20002000

2001-
_CCCL_SUPPRESS_DEPRECATED_PUSH
20022001
_CCCL_EXEC_CHECK_DISABLE
20032002
template <class Opt,
20042003
class F,
@@ -2009,12 +2008,20 @@ _CCCL_HOST_DEVICE auto optional_map_impl(Opt&& opt, F&& f)
20092008
if (opt.has_value())
20102009
{
20112010
detail::invoke(std::forward<F>(f), *std::forward<Opt>(opt));
2011+
# if _CCCL_COMPILER(MSVC)
2012+
// MSVC fails to suppress the warning on make_optional
2013+
_CCCL_SUPPRESS_DEPRECATED_PUSH
2014+
return optional<monostate>(monostate{});
2015+
_CCCL_SUPPRESS_DEPRECATED_POP
2016+
# else
2017+
_CCCL_SUPPRESS_DEPRECATED_PUSH
20122018
return make_optional(monostate{});
2019+
_CCCL_SUPPRESS_DEPRECATED_POP
2020+
# endif
20132021
}
20142022

20152023
return optional<monostate>(nullopt);
20162024
}
2017-
_CCCL_SUPPRESS_DEPRECATED_POP
20182025
# else
20192026
_CCCL_EXEC_CHECK_DISABLE
20202027
template <class Opt,

0 commit comments

Comments
 (0)