Remove UB std:: declarations (#709)

Remove custom delcarations inside `std::` of which behaviors are
undefined by the standard
This commit is contained in:
Changho Hwang
2026-01-05 11:11:46 +08:00
committed by GitHub
parent 2cf14ff723
commit fc221e234d
8 changed files with 82 additions and 73 deletions

View File

@@ -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<>())