CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
collection_extensions.h
1#pragma once
2
3#include <system/collections/list.h>
4#include <system/collections/ilist.h>
5#include <system/collections/read_only_collection.h>
6#include <system/span.h>
7
8namespace System {
9namespace Collections {
10namespace Generic {
11namespace CollectionExtensions {
12
14template<typename T>
15void AddRange(const SharedPtr<List<T>>& list, const ReadOnlySpan<T>& source)
16{
17 list->AddInitializer(source.get_Length(), source.data_ptr());
18}
19
21template <typename T>
23{
24 return System::MakeObject<ObjectModel::ReadOnlyCollection<T>>(list);
25}
26
27} // namespace CollectionExtensions
28} // namespace Generic
29} // namespace Collections
30} // namespace System
Interface of indexed container of elements. Objects of this class should only be allocated using Syst...
Definition: ilist.h:19
List forward declaration.
Definition: list.h:127
Forward to use within Span class.
Definition: span.h:404
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
void AddRange(const SharedPtr< List< T > > &list, const ReadOnlySpan< T > &source)
Adds all items from the source span to given list.
Definition: collection_extensions.h:15
SharedPtr< ObjectModel::ReadOnlyCollection< T > > AsReadOnly(const SharedPtr< IList< T > > &list)
Wraps given list with read-only collection.
Definition: collection_extensions.h:22
Definition: db_command.h:9