clang-format

This commit is contained in:
Pepijn Schoen
2017-04-03 10:28:46 +02:00
committed by Patrick Niklaus
parent 16665aeb00
commit 091a495632
15 changed files with 55 additions and 90 deletions
+1 -2
View File
@@ -22,8 +22,7 @@ namespace util
* NOTE: this type is templated for future use, but will require a slight refactor to
* configure BITSIZE and ELEMSIZE
*/
template <typename T,
osrm::storage::Ownership Ownership = osrm::storage::Ownership::Container>
template <typename T, osrm::storage::Ownership Ownership = osrm::storage::Ownership::Container>
class PackedVector
{
static const constexpr std::size_t BITSIZE = 33;
+1 -2
View File
@@ -216,8 +216,7 @@ template <unsigned BLOCK_SIZE, osrm::storage::Ownership Ownership> class RangeTa
};
template <unsigned BLOCK_SIZE, osrm::storage::Ownership Ownership>
unsigned RangeTable<BLOCK_SIZE, Ownership>::PrefixSumAtIndex(int index,
const BlockT &block) const
unsigned RangeTable<BLOCK_SIZE, Ownership>::PrefixSumAtIndex(int index, const BlockT &block) const
{
// this loop looks inefficent, but a modern compiler
// will emit nice SIMD here, at least for sensible block sizes. (I checked.)
+6 -10
View File
@@ -128,8 +128,7 @@ template <typename DataT> class vector_view
auto data() const { return m_ptr; }
template <typename T>
friend void swap(vector_view<T> &, vector_view<T> &) noexcept;
template <typename T> friend void swap(vector_view<T> &, vector_view<T> &) noexcept;
};
template <> class vector_view<bool>
@@ -163,13 +162,11 @@ template <> class vector_view<bool>
bool operator[](const unsigned index) const { return at(index); }
template <typename T>
friend void swap(vector_view<T> &, vector_view<T> &) noexcept;
template <typename T> friend void swap(vector_view<T> &, vector_view<T> &) noexcept;
};
// Both vector_view<T> and the vector_view<bool> specializations share this impl.
template <typename DataT>
void swap(vector_view<DataT> &lhs, vector_view<DataT> &rhs) noexcept
template <typename DataT> void swap(vector_view<DataT> &lhs, vector_view<DataT> &rhs) noexcept
{
std::swap(lhs.m_ptr, rhs.m_ptr);
std::swap(lhs.m_size, rhs.m_size);
@@ -177,10 +174,9 @@ void swap(vector_view<DataT> &lhs, vector_view<DataT> &rhs) noexcept
template <typename DataT, osrm::storage::Ownership Ownership> struct ShM
{
using vector =
typename std::conditional<Ownership == osrm::storage::Ownership::View,
vector_view<DataT>,
std::vector<DataT>>::type;
using vector = typename std::conditional<Ownership == osrm::storage::Ownership::View,
vector_view<DataT>,
std::vector<DataT>>::type;
};
}
}