mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-28 08:02:00 +00:00
use std::is_same<...>::value instead of std::is_same_v<...> for c++11 compliance
This commit is contained in:
parent
9fb90cb30c
commit
19d8f06c52
@ -438,9 +438,9 @@ struct string_caster {
|
|||||||
cast(const StringType &src, return_value_policy /* policy */, handle /* parent */) {
|
cast(const StringType &src, return_value_policy /* policy */, handle /* parent */) {
|
||||||
const char *buffer = reinterpret_cast<const char *>(src.data());
|
const char *buffer = reinterpret_cast<const char *>(src.data());
|
||||||
auto nbytes = ssize_t(src.size() * sizeof(CharT));
|
auto nbytes = ssize_t(src.size() * sizeof(CharT));
|
||||||
if (std::is_same_v<CharT, uint8_t>
|
if (std::is_same<CharT, uint8_t>::value
|
||||||
#if defined(PYBIND11_CPP17)
|
#if defined(PYBIND11_CPP17)
|
||||||
or std::is_same_v<CharT, std::byte>
|
|| std::is_same<CharT, std::byte>::value
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
return PyBytes_FromStringAndSize(buffer, nbytes);
|
return PyBytes_FromStringAndSize(buffer, nbytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user