// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. #pragma once #include #include #include #include #include "tsl/robin_set.h" namespace AnyWrapper { /* * Base Struct to hold refrence to the data. * Note: No memory mamagement, caller need to keep object alive. */ struct AnyReference { template AnyReference(Ty &reference) : _data(&reference) { } template Ty &get() { auto ptr = std::any_cast(_data); return *ptr; } private: std::any _data; }; struct AnyRobinSet : public AnyReference { template AnyRobinSet(const tsl::robin_set &robin_set) : AnyReference(robin_set) { } template AnyRobinSet(tsl::robin_set &robin_set) : AnyReference(robin_set) { } }; struct AnyVector : public AnyReference { template AnyVector(const std::vector &vector) : AnyReference(vector) { } template AnyVector(std::vector &vector) : AnyReference(vector) { } }; } // namespace AnyWrapper