ID 5776330
Пользователь Морозов Игнат Владимирович
Время 07:38<< 15.11.2021 07:39 (26 д. 05:39) 07:40>>
Обработка 07:39 ... 07:39 (3,65 сек.)
Файл 5776330.cpp (CLang++ 5.0.0 + Address Sanitizer)
Турнир 2 курс. Программирование на C++. Турнир 2, осень 2021
Задача C: Smart Pointer
Набор тестов
Ограничения Время: 25с Память: 512Мб
Состояние  [?]
CE Ошибка компиляции
код | результаты
In file included from main.cpp:2:0:
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*()':
SmartPointer.hpp:88:38: error: no matching function for call to 'smart_pointer::exception::exception(const char [4])'
             throw new exception("dfs");
                                      ^
In file included from /usr/include/c++/7/exception:38:0,
                 from /usr/include/c++/7/new:40,
                 from /usr/include/c++/7/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/memory:63,
                 from SmartPointer.hpp:2,
                 from main.cpp:2:
/usr/include/c++/7/bits/exception.h:60:9: note: candidate: constexpr std::exception::exception(const std::exception&)
   class exception
         ^~~~~~~~~
In file included from main.cpp:2:0:
SmartPointer.hpp:10:23: note:   inherited here
     using base_class::base_class;
                       ^~~~~~~~~~
SmartPointer.hpp:10:23: note:   an inherited constructor is not a candidate for initialization from an expression of the same or derived type
SmartPointer.hpp:8:7: note: candidate: smart_pointer::exception::exception()
 class exception : std::exception {
       ^~~~~~~~~
SmartPointer.hpp:8:7: note:   candidate expects 0 arguments, 1 provided
SmartPointer.hpp:8:7: note: candidate: constexpr smart_pointer::exception::exception(const smart_pointer::exception&)
SmartPointer.hpp:8:7: note:   no known conversion for argument 1 from 'const char [4]' to 'const smart_pointer::exception&'
SmartPointer.hpp:8:7: note: candidate: constexpr smart_pointer::exception::exception(smart_pointer::exception&&)
SmartPointer.hpp:8:7: note:   no known conversion for argument 1 from 'const char [4]' to 'smart_pointer::exception&&'
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() const':
SmartPointer.hpp:95:38: error: no matching function for call to 'smart_pointer::exception::exception(const char [4])'
             throw new exception("fgr");
                                      ^
In file included from /usr/include/c++/7/exception:38:0,
                 from /usr/include/c++/7/new:40,
                 from /usr/include/c++/7/ext/new_allocator.h:33,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++allocator.h:33,
                 from /usr/include/c++/7/bits/allocator.h:46,
                 from /usr/include/c++/7/memory:63,
                 from SmartPointer.hpp:2,
                 from main.cpp:2:
/usr/include/c++/7/bits/exception.h:60:9: note: candidate: constexpr std::exception::exception(const std::exception&)
   class exception
         ^~~~~~~~~
In file included from main.cpp:2:0:
SmartPointer.hpp:10:23: note:   inherited here
     using base_class::base_class;
                       ^~~~~~~~~~
SmartPointer.hpp:10:23: note:   an inherited constructor is not a candidate for initialization from an expression of the same or derived type
SmartPointer.hpp:8:7: note: candidate: smart_pointer::exception::exception()
 class exception : std::exception {
       ^~~~~~~~~
SmartPointer.hpp:8:7: note:   candidate expects 0 arguments, 1 provided
SmartPointer.hpp:8:7: note: candidate: constexpr smart_pointer::exception::exception(const smart_pointer::exception&)
SmartPointer.hpp:8:7: note:   no known conversion for argument 1 from 'const char [4]' to 'const smart_pointer::exception&'
SmartPointer.hpp:8:7: note: candidate: constexpr smart_pointer::exception::exception(smart_pointer::exception&&)
SmartPointer.hpp:8:7: note:   no known conversion for argument 1 from 'const char [4]' to 'smart_pointer::exception&&'
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:92:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
SmartPointer.hpp: In member function 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() const [with T = float; Allocator = std::allocator<float>]':
SmartPointer.hpp:99:5: error: control reaches end of non-void function [-Werror=return-type]
     }
     ^
cc1plus: all warnings being treated as errors
0.035s 0.010s 9