Comments (4)
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:
- Remove std::string ctor
- 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.
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.
Agreed. I will add it shortly.
from azmq.
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)
- Add CI pipelines for building and running test on support platforms HOT 1
- Add zeromq guide book examples HOT 1
- test fails on OSX HOT 14
- the code use deprecated interfaces of boost::asio HOT 5
- max_sockets references incorrect ZMQ_MAXMSGSIZE HOT 2
- Doesn't build with latest catch2 HOT 2
- Publisher message is lost if sent just after bind HOT 2
- Included FindZeroMQ.cmake only works if ZeroMQ built with Visual Studio IDE HOT 1
- Message can be lost if the sender exits right after sending it
- Example in README.md is broken
- Add Support for Radio-Dish Pattern
- Disable install targets in CMakeLists.txt
- Make new release tag HOT 1
- Make new release tag
- io_context destructor hangs in zmq_ctx_term() if async socket operation is still pending HOT 1
- Build error on ARM64/Ubuntu 18.04 platform (nVidia Xavier)
- async_receive is not cancellable by the OR awaitable operator HOT 1
- cancel() runs completion handlers immediately but should post/defer them instead HOT 3
- Building with CMake
- Completion of async operation using boost::asio::yield_context not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azmq.