MCPcopy Create free account
hub / github.com/AllentDan/LibtorchTutorials / iteration_proxy

Class iteration_proxy

lesson6-Segmentation/json.hpp:3929–3951  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3927
3928/// proxy class for the items() function
3929template<typename IteratorType> class iteration_proxy
3930{
3931 private:
3932 /// the container to iterate
3933 typename IteratorType::reference container;
3934
3935 public:
3936 /// construct iteration proxy from a container
3937 explicit iteration_proxy(typename IteratorType::reference cont) noexcept
3938 : container(cont) {}
3939
3940 /// return iterator begin (needed for range-based for)
3941 iteration_proxy_value<IteratorType> begin() noexcept
3942 {
3943 return iteration_proxy_value<IteratorType>(container.begin());
3944 }
3945
3946 /// return iterator end (needed for range-based for)
3947 iteration_proxy_value<IteratorType> end() noexcept
3948 {
3949 return iteration_proxy_value<IteratorType>(container.end());
3950 }
3951};
3952// Structured Bindings Support
3953// For further reference see https://blog.tartanllama.xyz/structured-bindings/
3954// And see https://github.com/nlohmann/json/pull/1391

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected