From c5b071a902f6fab57f17f2a0198227d1b76958d7 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Sat, 20 Aug 2022 11:03:30 -0400 Subject: [PATCH] Add constexpr to detail:forward_like --- include/pybind11/stl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/stl.h b/include/pybind11/stl.h index 6426bff083..48031c2a60 100644 --- a/include/pybind11/stl.h +++ b/include/pybind11/stl.h @@ -45,7 +45,7 @@ using forwarded_type = conditional_t::value, /// Forwards a value U as rvalue or lvalue according to whether T is rvalue or lvalue; typically /// used for forwarding a container's elements. template -forwarded_type forward_like(U &&u) { +constexpr forwarded_type forward_like(U &&u) { return std::forward>(std::forward(u)); }