LINUX.ORG.RU

История изменений

Исправление d_a, (текущая версия) :

Неть, почему, я проверял, ошибочку пишет и не компилирует:

            try { throw generic::Exception("%s", std::string("/path/to/file")); }
            catch (std::exception &e) { std::cout << e.what() << std::endl; }

exceptions.hpp:43:69: error: cannot pass objects of non-trivially-copyable type ‘class std::basic_string<char>’ through ‘...’
             size_t size = std::snprintf(nullptr, 0, format, args ...) + 1;
                                                                     ^
exceptions.hpp:45:60: error: cannot pass objects of non-trivially-copyable type ‘class std::basic_string<char>’ through ‘...’
             std::snprintf(buf.get(), size, format, args ...);
                                                            ^


А иначе нафиг он конечно нужен был бы :)

Исходная версия d_a, :

Неть, почему, я проверял, ошибочку пишет и не компилирует:

            try { throw generic::Exception("%s", std::string("/path/to/file")); }
            catch (std::exception &e) { std::cout << e.what() << std::endl; }

exceptions.hpp:43:69: error: cannot pass objects of non-trivially-copyable type ‘class std::basic_string<char>’ through ‘...’
             size_t size = std::snprintf(nullptr, 0, format, args ...) + 1;
                                                                     ^
/home/d_a/work/reanimate/m2014-apview/generic/exceptions.hpp:45:60: error: cannot pass objects of non-trivially-copyable type ‘class std::basic_string<char>’ through ‘...’
             std::snprintf(buf.get(), size, format, args ...);
                                                            ^


А иначе нафиг он конечно нужен был бы :)