MCPcopy Create free account
hub / github.com/apache/fory / collection_insert

Function collection_insert

cpp/fory/serialization/collection_serializer.h:402–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400// Helper to insert element into container (vector or set)
401template <typename Container, typename T>
402inline void collection_insert(Container &result, T &&elem) {
403 if constexpr (has_push_back_v<Container, T>) {
404 result.push_back(std::forward<T>(elem));
405 } else {
406 result.insert(std::forward<T>(elem));
407 }
408}
409
410/// Read collection data for polymorphic or shared-ref elements.
411template <typename T, typename Container>

Calls

no outgoing calls

Tested by

no test coverage detected