/**************************************************************************** ** Copyright (c) 2023, Fougue Ltd. ** All rights reserved. ** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt ****************************************************************************/ #pragma once #include #include #include // For std::forward() namespace Mayo { // Template alias for OpenCascade handle template using OccHandle = opencascade::handle; // Constructs an object of type 'T' wrapped in an OpenCascade handle // Note: Standard_Transient must be a base class of 'T' template OccHandle makeOccHandle(Args&&... args) { return new T(std::forward(args)...); } } // namespace Mayo #if OCC_VERSION_HEX < 0x070800 namespace std { // Specialization of C++11 std::hash<> functor for opencascade::handle<> objects template struct hash> { inline std::size_t operator()(const opencascade::handle& hnd) const { return hash{}(hnd.get()); } }; } // namespace std #endif