.com
-
, , , , : ; .
, , : - .
, ++. , , .
. () .
, , , , , . , .
:
std:: aligned_storage;
template<std::size_t Len, std::size_t Align >
struct aligned_storage {
typedef struct {
alignas(Align) unsigned char data[Len];
} type;
};
, std::aligned_storage
. ,
template<typename T>
using storage_of = std::aligned_storage<sizeof(T), alignof(T)>::type;
, T, , , . .
std::aligned_storage
, . , . , , , type::data
.
:
template<
class T,
class Container = std::vector<T>,
class Compare = std::less<typename Container::value_type>
> class priority_queue { };
:
, , ?
, . std::priority_queue
- , . :
template<typename C>
using PriorityQueue = std::priority_queue<C>;
, . , , .
std::priority_queue
, , . , , . .
, , PriotityQueue. , , , Boost.Heap Qt , . , - , , .
(Meta-)
, , storage_of
typename, -. , , , , Turing-complete. - , , , (.. )
using Z = void;
template<typename> struct Zermelo;
template<typename N> using Successor = Zermelo<N>;
, . , , , .
, . .
, ( template<class Iterator> struct is_pointer_like;
template<class It> generateSomeData(It outputIterator) {
if constexpr(is_pointer_like<outputIterator>::value) {
generateFastIntoBuffer(static_cast<typename It::pointer> (std::addressof(*outputIterator));
} else {
generateOneByOne(outputIterator);
}
}
, - .