// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 /** * @file * @author Stephen Kiazyk * * Potentially useful extensions to the header */ #pragma once #include #include namespace frantic { /** * Returns a homogeneous pair that is in 'sorted' order. * This is useful if you need a pair type as elements of a set. */ template std::pair make_sorted_pair( const T& u, const T& v ) { return std::make_pair( std::min( u, v ), std::max( u, v ) ); } template inline void clear_with_swap( std::vector& v ) { std::vector temp; v.swap( temp ); } template inline void shrink_to_fit( std::vector& v ) { std::vector temp( v.begin(), v.end() ); v.swap( temp ); } } // namespace frantic