Giter Site home page Giter Site logo

Comments (4)

rodgert avatar rodgert commented on September 27, 2024

It is sugar, definitely but not an uncommon usage. I propose
boost::string_ref (std::string_view under '17) as an alternative.

On Monday, September 28, 2015, Andrey Upadyshev [email protected]
wrote:

azmq::message has only a syntax sugar ctor to construct from std::string.
Any other construction from common "buffer representation" (e.g. c-string,
void ptr + size, std::array etc) needs a call of boost::asio::buffer().
This is:

  • confusing: different "buffer representations" needs different syntax
    to construct a message from
  • non-effective: when user constructs message from c-string, temporary
    std::string is allocated.

I propose either:

  1. Remove std::string ctor
  2. Add syntax sugar ctors for common "buffer representations", at
    least for the following ones:
    • const void * + size_t
    • c-string


Reply to this email directly or view it on GitHub
#113.

from azmq.

oliora avatar oliora commented on September 27, 2024

Let's add boost::string_ref constructor and remove std::string one then.

std::string_view one may be added later when it became widely available in compilers.

from azmq.

rodgert avatar rodgert commented on September 27, 2024

Agreed. I will add it shortly.

from azmq.

rodgert avatar rodgert commented on September 27, 2024

I may get a chance to do this today, I have immediate use for it.

On Tuesday, September 29, 2015, Andrey Upadyshev [email protected]
wrote:

Let's add boost::string_ref constructor and remove std::string one then.

std::string_view one may be added later when it became widely available
in compilers.


Reply to this email directly or view it on GitHub
#113 (comment).

from azmq.

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.