xapian-core  1.4.20
Functions
alignment_cast.h File Reference

Cast a pointer we know is suitably aligned. More...

#include <type_traits>
+ Include dependency graph for alignment_cast.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename T , typename U >
std::enable_if< std::is_const< typename std::remove_pointer< U >::type >::value, T >::type alignment_cast (U ptr)
 Cast a pointer we know is suitably aligned. More...
 
template<typename T , typename U >
std::enable_if<!std::is_const< typename std::remove_pointer< U >::type >::value, T >::type alignment_cast (U ptr)
 Cast a pointer we know is suitably aligned. More...
 

Detailed Description

Cast a pointer we know is suitably aligned.

Definition in file alignment_cast.h.

Function Documentation

◆ alignment_cast() [1/2]

template<typename T , typename U >
std::enable_if<std::is_const<typename std::remove_pointer<U>::type>::value, T>::type alignment_cast ( ptr)

Cast a pointer we know is suitably aligned.

Has the same effect as reinterpret_cast<T> but avoids warnings about alignment issues.

Version for const pointers.

Definition at line 39 of file alignment_cast.h.

Referenced by Xapian::SnowballStemImplementation::CAPACITY(), Xapian::Internal::closefrom(), do_aligned_read(), do_aligned_write(), Glass::Cursor::get_n(), Glass::Cursor::refs(), Xapian::SnowballStemImplementation::SET_CAPACITY(), Glass::Cursor::set_n(), Xapian::SnowballStemImplementation::SET_SIZE(), and Xapian::SnowballStemImplementation::SIZE().

◆ alignment_cast() [2/2]

template<typename T , typename U >
std::enable_if<!std::is_const<typename std::remove_pointer<U>::type>::value, T>::type alignment_cast ( ptr)

Cast a pointer we know is suitably aligned.

Has the same effect as reinterpret_cast<T> but avoids warnings about alignment issues.

Version for non-const pointers.

Definition at line 53 of file alignment_cast.h.