Giter Club home page Giter Club logo

Comments (4)

jwakely avatar jwakely commented on July 30, 2024 1

some sort of 8-bit quantity

What if there is no such type on the host?

Returning std::uint8_t* would be a completely compatible change

No it wouldn't, because uint8_t is not guaranteed to exist, consider systems with 16-bit bytes.

As noted above there are various proposals for span types, and std::byte could be useful here. We can evaluate them for a v2 of this TS, or when moving these things into the main standard.

from networking-ts.

jwakely avatar jwakely commented on July 30, 2024

Thanks for the suggestion. The latest draft has been sent to ISO as a PDTS now, so I'll raise this as a national body against the PDTS so that the committee considers it.

from networking-ts.

vinniefalco avatar vinniefalco commented on July 30, 2024

I'm just going to throw this out there - it sure would be nice if const_buffer::data and mutable_buffer::data returned a pointer to some sort of 8-bit quantity instead of a pointer to void. This would allow pointer arithmetic.

I forsee the use of const_buffer for much more than just networking operations. Its a great general purpose class. You could use it in a key/value database interface to pass buffers around. We have our own Slice class which works just like const_buffer, and we will switch to const_buffer when it appears in the standard. But data returning void* is really rather pointless. Returning std::uint8_t* would be a completely compatible change, and the return value would then have more utility.

from networking-ts.

jwakely avatar jwakely commented on July 30, 2024

This was submitted as a National Body comment against the PDTS, and discussed by the Library Evolution Working Group, see https://issues.isocpp.org/show_bug.cgi?id=301

from networking-ts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.