Comments (2)
Hi,
I'm glad you like it ;)
But that you're asking is easier said than done.
The problem is that const and non-const iterator has different types for non-const buffer type, and InputBufferAdapter depends only on buffer type(it needs buffer type, to get additional information from BufferAdapterTraits), and not on iterator type.
However, you can specify const buffer type, as template parameter for InputBufferAdapter, in this case it should work with const iterator.
e.g.
using Buffer = std::vector<uint8_t>;
using Reader = InputBufferAdapter<const Buffer>; // make buffer type const
...
Buffer buf{};
...
Deserializer<Reader> des(buf.begin(), buf.end()); // works
...
Deserializer<Reader> des(buf.cbegin(), buf.cend()); // also works
Hope that helped.
from bitsery.
Thank you, it works perfect. 👍
from bitsery.
Related Issues (20)
- Custom Extension HOT 1
- bug in apple libc++ ARM hash_code function HOT 2
- Windows and boost::json - compile error HOT 1
- Need help writing separate serializer and deserializer functions for a custom vector type HOT 1
- Easy serialization for POD types HOT 12
- It can't serialize a array member HOT 4
- How to serialize a pointer of map? HOT 2
- Vector of variants with a bit-packed type HOT 2
- Example usage of uint8_t* buffer? HOT 5
- Is bitsery faster than capnp? HOT 1
- Proper way to determine required buffer size before serializing? HOT 2
- Vector<String *> HOT 1
- Vector of bit-packed structs not measuring correctly? HOT 6
- Can I parse bitsery-serialized buffer using Python struct.unpack? HOT 2
- Are there any single header version available? HOT 2
- Does this use dynamic allocation? HOT 3
- How to find the reason of InvalidData? HOT 1
- Parallel read and write? HOT 1
- Writing to pointer to uint8_t array HOT 1
- Problem with deserialization of structure - Assertion newOffset <= _endReadOffset HOT 1
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 bitsery.