mirror of
https://github.com/microsoft/mscclpp.git
synced 2026-06-07 08:14:51 +00:00
Remove UB std:: declarations (#709)
Remove custom delcarations inside `std::` of which behaviors are undefined by the standard
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <nanobind/stl/vector.h>
|
||||
|
||||
#include <mscclpp/core.hpp>
|
||||
#include <sstream>
|
||||
|
||||
namespace nb = nanobind;
|
||||
using namespace mscclpp;
|
||||
@@ -122,7 +123,11 @@ void register_core(nb::module_& m) {
|
||||
.def(nb::init<DeviceType, int>(), nb::arg("type"), nb::arg("id") = -1)
|
||||
.def_rw("type", &Device::type)
|
||||
.def_rw("id", &Device::id)
|
||||
.def("__str__", [](const Device& self) { return std::to_string(self); });
|
||||
.def("__str__", [](const Device& self) {
|
||||
std::stringstream ss;
|
||||
ss << self;
|
||||
return ss.str();
|
||||
});
|
||||
|
||||
nb::class_<EndpointConfig::Ib>(m, "EndpointConfigIb")
|
||||
.def(nb::init<>())
|
||||
|
||||
Reference in New Issue
Block a user