Commit 0e22fa73 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

C++14 simplifications

parent ab68ce89
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ class Array : public Object
      using HostType = Containers::Array< Value, Devices::Host, Index >;
      using CudaType = Containers::Array< Value, Devices::Cuda, Index >;
      using ViewType = ArrayView< Value, Device, Index >;
      using ConstViewType = ArrayView< typename std::add_const< Value >::type, Device, Index >;
      using ConstViewType = ArrayView< std::add_const_t< Value >, Device, Index >;

      /**
       * \brief Basic constructor.
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

#pragma once

#include <type_traits>  // std::add_const
#include <type_traits>  // std::add_const_t

#include <TNL/File.h>
#include <TNL/Devices/Host.h>
@@ -72,7 +72,7 @@ public:
   using HostType = ArrayView< Value, Devices::Host, Index >;
   using CudaType = ArrayView< Value, Devices::Cuda, Index >;
   using ViewType = ArrayView< Value, Device, Index >;
   using ConstViewType = ArrayView< typename std::add_const< Value >::type, Device, Index >;
   using ConstViewType = ArrayView< std::add_const_t< Value >, Device, Index >;

   /**
    * \brief Returns type of array view in C++ style.
+2 −4
Original line number Diff line number Diff line
@@ -12,8 +12,6 @@

#pragma once

#include <type_traits>  // std::add_const

#include <TNL/Containers/Array.h>
#include <TNL/Containers/DistributedArrayView.h>

@@ -36,11 +34,11 @@ public:
   using LocalRangeType = Subrange< Index >;
   using LocalArrayType = Containers::Array< Value, Device, Index >;
   using LocalArrayViewType = Containers::ArrayView< Value, Device, Index >;
   using ConstLocalArrayViewType = Containers::ArrayView< typename std::add_const< Value >::type, Device, Index >;
   using ConstLocalArrayViewType = Containers::ArrayView< std::add_const_t< Value >, Device, Index >;
   using HostType = DistributedArray< Value, Devices::Host, Index, Communicator >;
   using CudaType = DistributedArray< Value, Devices::Cuda, Index, Communicator >;
   using ViewType = DistributedArrayView< Value, Device, Index, Communicator >;
   using ConstViewType = DistributedArrayView< typename std::add_const< Value >::type, Device, Index, Communicator >;
   using ConstViewType = DistributedArrayView< std::add_const_t< Value >, Device, Index, Communicator >;

   DistributedArray() = default;

+2 −2
Original line number Diff line number Diff line
@@ -33,11 +33,11 @@ public:
   using IndexType = Index;
   using LocalRangeType = Subrange< Index >;
   using LocalArrayViewType = Containers::ArrayView< Value, Device, Index >;
   using ConstLocalArrayViewType = Containers::ArrayView< typename std::add_const< Value >::type, Device, Index >;
   using ConstLocalArrayViewType = Containers::ArrayView< std::add_const_t< Value >, Device, Index >;
   using HostType = DistributedArrayView< Value, Devices::Host, Index, Communicator >;
   using CudaType = DistributedArrayView< Value, Devices::Cuda, Index, Communicator >;
   using ViewType = DistributedArrayView< Value, Device, Index, Communicator >;
   using ConstViewType = DistributedArrayView< typename std::add_const< Value >::type, Device, Index, Communicator >;
   using ConstViewType = DistributedArrayView< std::add_const_t< Value >, Device, Index, Communicator >;

   // Initialization by raw data
   __cuda_callable__
+2 −2
Original line number Diff line number Diff line
@@ -33,11 +33,11 @@ public:
   using CommunicatorType = Communicator;
   using IndexType = Index;
   using LocalVectorViewType = Containers::VectorView< Real, Device, Index >;
   using ConstLocalVectorViewType = Containers::VectorView< typename std::add_const< Real >::type, Device, Index >;
   using ConstLocalVectorViewType = Containers::VectorView< std::add_const_t< Real >, Device, Index >;
   using HostType = DistributedVector< Real, Devices::Host, Index, Communicator >;
   using CudaType = DistributedVector< Real, Devices::Cuda, Index, Communicator >;
   using ViewType = DistributedVectorView< Real, Device, Index, Communicator >;
   using ConstViewType = DistributedVectorView< typename std::add_const< Real >::type, Device, Index, Communicator >;
   using ConstViewType = DistributedVectorView< std::add_const_t< Real >, Device, Index, Communicator >;

   // inherit all constructors and assignment operators from Array
   using BaseType::DistributedArray;
Loading