[sprout.array] support for C++14 constexpr

This commit is contained in:
bolero-MURAKAMI 2013-10-26 00:32:36 +09:00
parent 227e7789ec
commit c40b33067e
34 changed files with 87 additions and 70 deletions

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
copy(InputIterator first, InputIterator last, OutputIterator result) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename BidirectionalIterator1, typename BidirectionalIterator2,
typename sprout::enabler_if<sprout::is_output_iterator<BidirectionalIterator2>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<BidirectionalIterator2>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR BidirectionalIterator2
copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last, BidirectionalIterator2 result) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator, typename Predicate,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename Size, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
copy_n(InputIterator first, Size n, OutputIterator result) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename OutputIterator, typename Size, typename T,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
fill_n(OutputIterator first, Size n, T const& value) {

View file

@ -139,7 +139,7 @@ namespace sprout {
template<
typename InputIterator, typename Result,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
copy(InputIterator first, InputIterator last, Result const& result) {

View file

@ -129,7 +129,7 @@ namespace sprout {
template<
typename BidirectionalIterator, typename Result,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
copy_backward(BidirectionalIterator first, BidirectionalIterator last, Result const& result) {

View file

@ -94,7 +94,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
copy_if(InputIterator first, InputIterator last, Result const& result, Predicate pred) {

View file

@ -112,7 +112,7 @@ namespace sprout {
template<
typename InputIterator, typename Size, typename Result,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
copy_n(InputIterator first, Size n, Result const& result) {

View file

@ -68,7 +68,7 @@ namespace sprout {
template<
typename Container, typename Size, typename T,
typename sprout::enabler_if<!sprout::is_output_iterator<Container>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Container>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Container>::type
fill_n(Container const& cont, Size n, T const& value) {

View file

@ -34,7 +34,7 @@ namespace sprout {
template<
typename Container, typename Size, typename Generator,
typename sprout::enabler_if<!sprout::is_output_iterator<Container>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Container>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Container>::type
generate_n(Container const& cont, Size n, Generator const& gen) {

View file

@ -97,7 +97,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename T,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
remove_copy(InputIterator first, InputIterator last, Result const& result, T const& value) {

View file

@ -97,7 +97,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename Predicate,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
remove_copy_if(InputIterator first, InputIterator last, Result const& result, Predicate pred) {

View file

@ -150,7 +150,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename T,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
replace_copy(InputIterator first, InputIterator last, Result const& result, T const& old_value, T const& new_value) {

View file

@ -149,7 +149,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename Predicate, typename T,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
replace_copy_if(InputIterator first, InputIterator last, Result const& result, Predicate pred, T const& new_value) {

View file

@ -139,7 +139,7 @@ namespace sprout {
template<
typename BidirectionalIterator, typename Result,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
reverse_copy(BidirectionalIterator first, BidirectionalIterator last, Result const& result) {

View file

@ -182,7 +182,7 @@ namespace sprout {
template<
typename ForwardIterator, typename Result,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, Result const& result) {

View file

@ -264,7 +264,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename UnaryOperation,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
transform(InputIterator first, InputIterator last, Result const& result, UnaryOperation op) {
@ -272,7 +272,7 @@ namespace sprout {
}
template<
typename Result, typename InputIterator, typename UnaryOperation,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
transform(InputIterator first, InputIterator last, UnaryOperation op) {
@ -281,7 +281,7 @@ namespace sprout {
template<
typename InputIterator1, typename InputIterator2, typename Result, typename BinaryOperation,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, Result const& result, BinaryOperation op) {
@ -289,7 +289,7 @@ namespace sprout {
}
template<
typename Result, typename InputIterator1, typename InputIterator2, typename BinaryOperation,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, BinaryOperation op) {

View file

@ -182,7 +182,7 @@ namespace sprout {
template<
typename InputIterator, typename Result,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
unique_copy(InputIterator first, InputIterator last, Result const& result) {
@ -197,7 +197,7 @@ namespace sprout {
template<
typename InputIterator, typename Result, typename BinaryPredicate,
typename sprout::enabler_if<!sprout::is_output_iterator<Result>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<Result>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
unique_copy(InputIterator first, InputIterator last, Result const& result, BinaryPredicate pred) {
@ -206,7 +206,7 @@ namespace sprout {
template<
typename Result, typename InputIterator, typename BinaryPredicate,
typename sprout::enabler_if<!sprout::is_output_iterator<BinaryPredicate>::value>::type = sprout::enabler
typename sprout::enabler_if<!sprout::is_iterator_outputable<BinaryPredicate>::value>::type = sprout::enabler
>
inline SPROUT_CONSTEXPR typename sprout::fixed::result_of::algorithm<Result>::type
unique_copy(InputIterator first, InputIterator last, BinaryPredicate pred) {

View file

@ -16,7 +16,7 @@ namespace sprout {
//
template<
typename OutputIterator, typename Size, typename Generator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
generate_n(OutputIterator first, Size n, Generator gen) {

View file

@ -19,7 +19,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
move(InputIterator first, InputIterator last, OutputIterator result) {

View file

@ -19,7 +19,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
move_backward(InputIterator first, InputIterator last, OutputIterator result) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator, typename T,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
remove_copy(InputIterator first, InputIterator last, OutputIterator result, T const& value) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator, typename Predicate,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
remove_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator, typename T,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR void
replace_copy(InputIterator first, InputIterator last, OutputIterator result, T const& old_value, T const& new_value) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator, typename Predicate, typename T,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR void
replace_copy_if(InputIterator first, InputIterator last, OutputIterator result, Predicate pred, T const& new_value) {

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename BidirectionalIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result) {

View file

@ -19,7 +19,7 @@ namespace sprout {
//
template<
typename ForwardIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
rotate_copy(ForwardIterator first, ForwardIterator middle, ForwardIterator last, OutputIterator result) {

View file

@ -19,7 +19,7 @@ namespace sprout {
inline SPROUT_CXX14_CONSTEXPR ForwardIterator2
swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2) {
while (first1 != last1) {
sprout::iter_swap(*first1++, *first2++);
sprout::iter_swap(first1++, first2++);
}
return first2;
}

View file

@ -18,7 +18,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator, typename UnaryOperation,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
transform(InputIterator first, InputIterator last, OutputIterator result, UnaryOperation op) {
@ -29,7 +29,7 @@ namespace sprout {
}
template<
typename InputIterator1, typename InputIterator2, typename OutputIterator, typename BinaryOperation,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
transform(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, OutputIterator result, BinaryOperation op) {

View file

@ -19,7 +19,7 @@ namespace sprout {
//
template<
typename InputIterator, typename OutputIterator,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
unique_copy(InputIterator first, InputIterator last, OutputIterator result) {
@ -39,7 +39,7 @@ namespace sprout {
template<
typename InputIterator, typename OutputIterator, typename BinaryPredicate,
typename sprout::enabler_if<sprout::is_output_iterator<OutputIterator>::value>::type = sprout::enabler
typename sprout::enabler_if<sprout::is_iterator_outputable<OutputIterator>::value>::type = sprout::enabler
>
inline SPROUT_CXX14_CONSTEXPR OutputIterator
unique_copy(InputIterator first, InputIterator last, OutputIterator result, BinaryPredicate pred) {