mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 18:56:19 +08:00
Applied the byte containers to all byte formats (#474)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "../Processors.hpp"
|
||||
#include "../Result.hpp"
|
||||
#include "../concepts.hpp"
|
||||
#include "../internal/ptr_cast.hpp"
|
||||
#include "Parser.hpp"
|
||||
|
||||
@@ -25,7 +26,7 @@ auto read(const InputVarType& _obj) {
|
||||
|
||||
/// Parses an object from flexbuf using reflection.
|
||||
template <class T, class... Ps>
|
||||
auto read(const char* _bytes, const size_t _size) {
|
||||
auto read(const concepts::ByteLike auto* _bytes, const size_t _size) {
|
||||
const InputVarType root =
|
||||
flexbuffers::GetRoot(internal::ptr_cast<const uint8_t*>(_bytes), _size);
|
||||
return read<T, Ps...>(root);
|
||||
@@ -33,7 +34,7 @@ auto read(const char* _bytes, const size_t _size) {
|
||||
|
||||
/// Parses an object from flexbuf using reflection.
|
||||
template <class T, class... Ps>
|
||||
auto read(const std::vector<char>& _bytes) {
|
||||
auto read(const concepts::ContiguousByteContainer auto& _bytes) {
|
||||
return read<T, Ps...>(_bytes.data(), _bytes.size());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user