@ProCxx

Страница 1078 из 2477
Neli
12.07.2017
09:43:11
Что-то слишком много людей. ._.

Google
Alexander
12.07.2017
09:57:46
Hi, Would anyone be interested in adding std::shift to <algorithm>? It would be similar to both: - std::rotate, but without moving the head elements back to the tail. This would allow a more efficient implementation and clearer semantics in case rotation is not needed as well as correctness in case rotation is undesired. - <algorithm>'s std::move/std::move_backward (depending on the shift direction). std::shift should probably accommodate both left and right shifts by one of: - giving it either begin() and end(), or rbegin() and rend(), similar to how std::rotate works for both left and right rotations. The advantage is compactness of the implementation. - allowing the shift count parameter to be either positive or negative. The advantage is compactness, though it might not be clear which direction is which - to be consistent with rotate, positive integers should shift to the left. - having std::shift_right and std::shift_left functions. The advantage is clarity when calling the methods, although the same argument could be made for having separate std::rotate_left and std::rotate_right instead of std::rotate, which we don't have. Here's a sample implementation of a shift to the right direction: template<class BidirIt> void shift_right(BidirIt first, BidirIt last, unsigned int n = 1) { std::move_backward(first, last - n, last); } This demonstrates that while std::shift is implementable with std::move/std::move_backward, 1) It isn't immediately clear from the code (at least to my eyes) that this is a shift right, unless you are intimately familiar with std::move_backward. 2) Different calls, either to std::move or to std::move_backward, are required, depending on the shift direction. So, implementing std::shift would allow writing more readable code.

Friedrich
12.07.2017
10:00:13
Модерация бдит. Не оффтопьте, пожалуйста.

Berkus
12.07.2017
10:03:09
git push -f origin pro.cxx

Antony
12.07.2017
10:06:47
Hi, Would anyone be interested in adding std::shift to <algorithm>? It would be similar to both: - std::rotate, but without moving the head elements back to the tail. This would allow a more efficient implementation and clearer semantics in case rotation is not needed as well as correctness in case rotation is undesired. - <algorithm>'s std::move/std::move_backward (depending on the shift direction). std::shift should probably accommodate both left and right shifts by one of: - giving it either begin() and end(), or rbegin() and rend(), similar to how std::rotate works for both left and right rotations. The advantage is compactness of the implementation. - allowing the shift count parameter to be either positive or negative. The advantage is compactness, though it might not be clear which direction is which - to be consistent with rotate, positive integers should shift to the left. - having std::shift_right and std::shift_left functions. The advantage is clarity when calling the methods, although the same argument could be made for having separate std::rotate_left and std::rotate_right instead of std::rotate, which we don't have. Here's a sample implementation of a shift to the right direction: template<class BidirIt> void shift_right(BidirIt first, BidirIt last, unsigned int n = 1) { std::move_backward(first, last - n, last); } This demonstrates that while std::shift is implementable with std::move/std::move_backward, 1) It isn't immediately clear from the code (at least to my eyes) that this is a shift right, unless you are intimately familiar with std::move_backward. 2) Different calls, either to std::move or to std::move_backward, are required, depending on the shift direction. So, implementing std::shift would allow writing more readable code.
+1 только * shift_right должен возвращать итератор (может даже два) * BOOST_CXX14_CONSTEXPR * memcpy оптимизация для TriviallyCopyable будет в тему

Alexander
12.07.2017
10:07:40
+1 только * shift_right должен возвращать итератор (может даже два) * BOOST_CXX14_CONSTEXPR * memcpy оптимизация для TriviallyCopyable будет в тему
Напиши эти замечания в Google-Groups, где пропозалы обсуждают. В свою очередь я это перетяну спокойно в Boost.Algorithm

Там можно уже решить, что да как должно выглядеть, заимплементим, а потом уже и в Станадарт намного легче тянуть

Constantine
12.07.2017
10:08:37
А в стандарте есть аналог memset для заполнения по 16 и 32?

Constantine
12.07.2017
10:09:40
то-то я не нашел)

Alexander
12.07.2017
10:09:48
А в стандарте есть аналог memset для заполнения по 16 и 32?
разгонять векторными штуками хочется?)

кмк это дело имплеменатции, чтобы специфичные кейсы разгонять по возможности

Constantine
12.07.2017
10:10:14
нет, в дебуге хочется релизное заполнение памяти использовать, ибо слишком тормозит без оптимизации :)

Google
Antony
12.07.2017
10:19:01
Alexander
12.07.2017
10:19:58
Не, пусть сами разбираются Я не единственый чел в комитете :)
ок, тогда я чуть позже скину им твои замечания. Просто не хочется, чтобы действительно полезная вещь ушла в небытие (как memory file mapping ? )

Admin
ERROR: S client not available

Anatoly
12.07.2017
10:20:10
если бы ты был один, проще было бы

Antony
12.07.2017
10:21:20
качество бы пострадало: одна голова хорошо, а сотня лучше

Anatoly
12.07.2017
10:22:10
зато скорость бы увеличилась принятия решения

Alexander
12.07.2017
10:22:37
зато скорость бы увеличилась принятия решения
скорость vs качество? Добро пожаловать в холивар ?

Anatoly
12.07.2017
10:22:45
:)

Igor
12.07.2017
10:41:13
о https://github.com/AnthonyCalandra/modern-cpp-features/blob/master/README.md баян?

Berkus
12.07.2017
10:42:24

Страница 1078 из 2477