8299397: Remove metaprogramming/isFloatingPoint.hpp

Reviewed-by: kbarrett, iwalulya, tschatzl
This commit is contained in:
Justin King 2023-01-02 14:36:01 +00:00 committed by Thomas Schatzl
parent 71a64a1b7a
commit ce6395a135
3 changed files with 2 additions and 98 deletions

View file

@ -1,50 +0,0 @@
/*
* Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_METAPROGRAMMING_ISFLOATINGPOINT_HPP
#define SHARE_METAPROGRAMMING_ISFLOATINGPOINT_HPP
#include "metaprogramming/integralConstant.hpp"
// This metafunction returns true iff the type T (irrespective of CV qualifiers)
// is a floating point type.
template <typename T> struct IsFloatingPoint: public FalseType {};
template <> struct IsFloatingPoint<float>: public TrueType {};
template <> struct IsFloatingPoint<const float>: public TrueType {};
template <> struct IsFloatingPoint<volatile float>: public TrueType {};
template <> struct IsFloatingPoint<const volatile float>: public TrueType {};
template <> struct IsFloatingPoint<double>: public TrueType {};
template <> struct IsFloatingPoint<const double>: public TrueType {};
template <> struct IsFloatingPoint<volatile double>: public TrueType {};
template <> struct IsFloatingPoint<const volatile double>: public TrueType {};
template <> struct IsFloatingPoint<long double>: public TrueType {};
template <> struct IsFloatingPoint<const long double>: public TrueType {};
template <> struct IsFloatingPoint<volatile long double>: public TrueType {};
template <> struct IsFloatingPoint<const volatile long double>: public TrueType {};
#endif // SHARE_METAPROGRAMMING_ISFLOATINGPOINT_HPP

View file

@ -31,7 +31,6 @@
#include "metaprogramming/decay.hpp"
#include "metaprogramming/enableIf.hpp"
#include "metaprogramming/integralConstant.hpp"
#include "metaprogramming/isFloatingPoint.hpp"
#include "metaprogramming/isIntegral.hpp"
#include "metaprogramming/isPointer.hpp"
#include "metaprogramming/isSame.hpp"
@ -1097,7 +1096,7 @@ namespace AccessInternal {
// not recognized as a valid primitive type to a primitive Access function.
STATIC_ASSERT((HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value || // oops have already been validated
(IsPointer<T>::value || IsIntegral<T>::value) ||
IsFloatingPoint<T>::value)); // not allowed primitive type
std::is_floating_point<T>::value)); // not allowed primitive type
}
template <DecoratorSet decorators, typename P, typename T>
@ -1217,7 +1216,7 @@ namespace AccessInternal {
size_t length) {
STATIC_ASSERT((HasDecorator<decorators, INTERNAL_VALUE_IS_OOP>::value ||
(IsSame<T, void>::value || IsIntegral<T>::value) ||
IsFloatingPoint<T>::value)); // arraycopy allows type erased void elements
std::is_floating_point<T>::value)); // arraycopy allows type erased void elements
typedef typename Decay<T>::type DecayedT;
const DecoratorSet expanded_decorators = DecoratorFixup<decorators | IS_ARRAY | IN_HEAP>::value;
return arraycopy_reduce_types<expanded_decorators>(src_obj, src_offset_in_bytes, const_cast<DecayedT*>(src_raw),

View file

@ -1,45 +0,0 @@
/*
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "memory/allocation.hpp"
#include "metaprogramming/isFloatingPoint.hpp"
#include "utilities/debug.hpp"
class IsFloatingPointTest: AllStatic {
STATIC_ASSERT(IsFloatingPoint<float>::value);
STATIC_ASSERT(IsFloatingPoint<double>::value);
STATIC_ASSERT(IsFloatingPoint<long double>::value);
STATIC_ASSERT(IsFloatingPoint<double const>::value);
STATIC_ASSERT(!IsFloatingPoint<double&>::value);
STATIC_ASSERT(!IsFloatingPoint<int>::value);
STATIC_ASSERT(!IsFloatingPoint<unsigned int>::value);
STATIC_ASSERT(!IsFloatingPoint<signed int>::value);
class A: AllStatic {};
STATIC_ASSERT(!IsFloatingPoint<A>::value);
STATIC_ASSERT(!IsFloatingPoint<A*>::value);
};