
Root
08.06.2017
19:59:07
Всем привет

Александр
08.06.2017
20:03:42
Расскажет кто, почему в пропозале wide_int некоторые функции noexcept(!Signed)? Почему не оставили UB или арифметику mod 2^N? Со вторым вроде как ясно - те же причины, что с int'ом

Evgeniy
08.06.2017
20:07:03
но если тебе нужна ты возьмешь либу

Google

Dmitry
08.06.2017
21:17:52
чуваки, у меня тут вопрос
#define CALL(name) (*(decltype(&name))((ptrdiff_t)(name) ^ 0xDEADCODE))
и
CALL(AnotherFunc)("d");
и все это скомпилировалось в
mov eax,<test_x86.AnotherFunc>
push test_x86.182014
xor eax,DEADC0DE
call eax
а я не хочу пуш между mov и xor, я хочу чтобы они всегда шли друг за другом.
что стоит сделать? компилятор - VS2017.

Evgeniy
08.06.2017
21:19:29

Dmitry
08.06.2017
21:20:14
мне что-то подсказывает, что таки да, ничего, но верить в это не очень удобно

Sergey
08.06.2017
21:38:59
я мальчик, не хочу пуш, а хочу фыр фыр фыр?

Dmitry
08.06.2017
21:41:20
хочу ноп ноп ноп!

Владислав
08.06.2017
21:55:26
когда споришь с компилятором

Alexender
08.06.2017
22:43:17
А как хочешь ? пуш, пуш, пуш вот и буш
чуваки, у меня тут вопрос
#define CALL(name) (*(decltype(&name))((ptrdiff_t)(name) ^ 0xDEADCODE))
и
CALL(AnotherFunc)("d");
и все это скомпилировалось в
mov eax,<test_x86.AnotherFunc>
push test_x86.182014
xor eax,DEADC0DE
call eax
а я не хочу пуш между mov и xor, я хочу чтобы они всегда шли друг за другом.
что стоит сделать? компилятор - VS2017.

Vladislav
08.06.2017
22:44:26

Alex Фэils?︙
08.06.2017
22:44:27
заинклудь ассеблерный файл

Vladislav
08.06.2017
22:44:44
Вообще, зачем это надо, интересно?
Еее

Alexender
08.06.2017
22:49:18
у тебя тут
в акамулятор идёт указатель AnotherFunc
далее закидывает в стек test_x86.182014 явно со смещением )
после побитовое "или" на проверку
и вызов функции

Google

Vladislav
09.06.2017
02:50:33
Привет)

Vlad
09.06.2017
02:50:49

Aidar
09.06.2017
03:58:18

Vladislav
09.06.2017
03:59:33
https://github.com/rswier/c4/blob/master/c4.c

Constantine
09.06.2017
05:13:04
А вообще самокомпилирующиеся компиляторы - та еще странная штука. Я где-то читал, как один товарищ модифицировал GCC таким образом, чтобы (а) модификация передавалась при компиляции GCC (б) при компиляции определенного исходного кода встраивалась дополнительная проверка на допустимость определенного пароля
В итоге получается вирусня, которой нет в исходном коде

Александр
09.06.2017
05:28:39

Antony
09.06.2017
07:04:38

Vladislav
09.06.2017
07:07:56

Antony
09.06.2017
07:10:28
например флажок -ftrapv, который может заставлять компилятор генерировать исключение в этом случае

Vladislav
09.06.2017
07:10:58
пусть генерирует, если UB уже случилось то можно делать что угодно, даже нарушать noexcept

Antony
09.06.2017
07:11:41
нельзя

Vladislav
09.06.2017
07:11:57
стандарт не запрещает

Antony
09.06.2017
07:12:36
нельзя. Честно честно

reagentoo
09.06.2017
07:51:10
Метапрограммирование должно быть без императивности.
Мнение.

Дед Пегас
09.06.2017
08:01:10
Даёшь ФП в массы!

reagentoo
09.06.2017
08:01:34
нет
только в темплейтики

Tengiz
09.06.2017
08:02:23
Добрый день господа, хотел бы услышать вашего совета:
Существуют ли в природе какие-нибудь статьи, рекомендации, best practices по публикации и распростронению C++ библиотеки.
Библиотека проприетарная, кроссплатформенная (windows, linux), зависит от кучи сторонних библиотек (ICU, boost и т.д.)

Google

Vlad
09.06.2017
08:11:31
если это не что-то супер-уникальное (что вряд ли)

Александр
09.06.2017
08:12:09

Tengiz
09.06.2017
08:12:11

Aleksei
09.06.2017
08:13:09
Проприетарные обычно в себя упаковывают нужные библиотеки

Дед Пегас
09.06.2017
08:13:31
Под лицензий MIT.
Слава Омниссии!

Vlad
09.06.2017
08:14:14

Alex Фэils?︙
09.06.2017
08:14:46

Vlad
09.06.2017
08:15:06

Tengiz
09.06.2017
08:15:25

Vlad
09.06.2017
08:16:30
http://www.stdthread.co.uk/order.html

Aleksei
09.06.2017
08:17:13
Да, зависит от лицензий библиотек. Под линукс говорите в инструкции, ставьте такие-то библиотеки (можно для убунты пример привести), а для винды dll нужные рядом кладете

Vlad
09.06.2017
08:17:44

Tengiz
09.06.2017
08:18:36

Дед Пегас
09.06.2017
08:18:58
Тупой вопрос: что нонче в плюсах есть годное для RPC?

Google

Vlad
09.06.2017
08:19:05

Admin
ERROR: S client not available

Дед Пегас
09.06.2017
08:19:12
А оно быстрое?
Нужно вот прям ваще RED GOZ FASTA

Vlad
09.06.2017
08:19:30
ну как сказать

Tengiz
09.06.2017
08:19:36

Vlad
09.06.2017
08:19:49

Tema
09.06.2017
08:20:25

Дед Пегас
09.06.2017
08:20:49
Есть msgpack http://msgpack.org/
Но я хз.
Правда, он в neo vim используется...

Vlad
09.06.2017
08:21:42

Дед Пегас
09.06.2017
08:23:36

Antony
09.06.2017
08:28:39
Метапрограммирование должно быть без императивности.
Два дня назад у меня коллега с работы возмущался вырвиглазным метапрограмнвм адищем, необходимым для применения функции к каждому элементу произвольного кортежа:
template <class Tuple, class Func, std::size_t... I>
void stringize_cpp11_impl(const Tuple& t, const Func& f, std::index_sequence<I...>) {
// Oops. Requires C++17 fold expressions feature.
// (f(std::get<I>(t)), ...);
int tmp[] = { 0, (f(std::get<I>(t)), 0)... };
(void)tmp; // Suppressing unused variable warnings.
}
template <class Tuple>
std::string stringize_cpp11(const Tuple& t) {
std::ostringstream result;
stringize_cpp11_impl(
t,
[&result](const auto& v) { result << v; },
std::make_index_sequence< std::tuple_size<Tuple>::value >()
);
return result;
}


Дед Пегас
09.06.2017
08:29:48
Два дня назад у меня коллега с работы возмущался вырвиглазным метапрограмнвм адищем, необходимым для применения функции к каждому элементу произвольного кортежа:
template <class Tuple, class Func, std::size_t... I>
void stringize_cpp11_impl(const Tuple& t, const Func& f, std::index_sequence<I...>) {
// Oops. Requires C++17 fold expressions feature.
// (f(std::get<I>(t)), ...);
int tmp[] = { 0, (f(std::get<I>(t)), 0)... };
(void)tmp; // Suppressing unused variable warnings.
}
template <class Tuple>
std::string stringize_cpp11(const Tuple& t) {
std::ostringstream result;
stringize_cpp11_impl(
t,
[&result](const auto& v) { result << v; },
std::make_index_sequence< std::tuple_size<Tuple>::value >()
);
return result;
}
Должн сказать в D это вышло бы красивей.

reagentoo
09.06.2017
08:31:18
у D всё метаговно императивное

Antony
09.06.2017
08:35:56
В императивном стиле получилось бы красивее и намного короче:
template <class Tuple>
std::string stringize_cpp11(const Tuple& t) {
std::ostringstream result;
for constexpr (const auto& v: t) {
result << v;
}
return std::move(result.str());
}

Alex Фэils?︙
09.06.2017
08:37:36

Дед Пегас
09.06.2017
08:37:51
Если бы лы constexpr for

Google

Alex Фэils?︙
09.06.2017
08:38:04
А, точно

Tengiz
09.06.2017
08:39:00

Alex Фэils?︙
09.06.2017
08:39:42

reagentoo
09.06.2017
08:43:16
if/for constexpr не вкусно

Igor
09.06.2017
08:48:37
if/for constexpr не вкусно
просто потому что стиль императивный, или из этого какие-то проблемы вытекают вроде замедления компиляции?

reagentoo
09.06.2017
08:49:57
потому что надо везде Meta<Govno>::value лепить

Tema
09.06.2017
08:59:09


Alexander
09.06.2017
09:07:00
привет. Автор cpp-sort не против того, чтобы его либа использовалась в Бусте. Но он сразу обрисовал несколько проблем
Hi,
First of all, I'm really flattered by the proposal :)
That said, cpp-sort have several major drawbacks that would probably make it unsuitable for Boost, most of them coming from the fact that it's mainly
a hobby project, which was never meant to become serious or to be used in production. I will try to be realistic and to list the main problems:
It currently only compiles with somewhat recent clang++ and g++; making some of the components work with MSVC will probably be hard, let alone with other compilers (the template metaprogramming & tricks might be a bit heavy in some places)
Some of the components such as sorter_facade try to automate too many things in the name of usability, making it hard to know exactly what it does (in theory the "right thing", but...)
Moreover the SFINAE in sorter_facade makes it rather hard to maintain, which is a shame for a central component of the library (plus it generates huge and unreadable error messages, and I can't even turn SFINAE into hard errors because some components such as hybrid_adapter rely on it)
Some of the lesser components such as container_aware_adapter are equally hard to maintain while not handling everything they should
I stole code all around when the licenses seemed compatible, which may be fine for a hobby project, but I guess that the licenses might be a problem for Boost
I don't understand every algorithm I stole, and would probably not be able to fix logic bugs in them
Many of the sorting algorithms are mostly useless
The useful algorithms could often be more useful with additional parameters, but I tried to cram everything under an iterable/comparison/projection interface and did not allow additional parameters to be passed (even though there are plans to circumvent that restriction by passing parameters to the sorters, and not only to their call operator)
I never used C++ professionally, which might not make me the best maintainer in the world :p
I think that it sums up the main problems that could prevent the inclusion of the library in Boost.
Now, if you want to pick bits from the library, or make a "cpp-sort light" which removes or simplifies some of the problematic elements, I'm not against it, and I would even be happy to help, but I don't know what would be the actual shape of a lighter version of the library (fewer useless algorithms and overthought building blocks for sure, but...). Also you would probably have to ask to the original authors of the code I didn't write whether they are ok with the inclusion of their code in Boost.
Best regards,
Morwenn