ID 5776345
Пользователь Морозов Игнат Владимирович
Время 07:48<< 15.11.2021 07:55 (26 д. 05:56) 16:02>>
Обработка 07:55 ... 07:55 (2,75 сек.)
Файл 5776345.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 instantiation of 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() const [with T = float; Allocator = std::allocator<float>; smart_pointer::SmartPointer<T, Allocator>::value_type = float]':
Test_SmartPointer.hpp:233:9:   required from here
SmartPointer.hpp:95:19: error: no matching function for call to 'smart_pointer::exception::exception(char)'
             throw exception('a');
                   ^~~~~~~~~~~~~~
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 'char' 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 'char' to 'smart_pointer::exception&&'
SmartPointer.hpp: In instantiation of 'smart_pointer::SmartPointer<T, Allocator>::value_type& smart_pointer::SmartPointer<T, Allocator>::operator*() [with T = float; Allocator = std::allocator<float>; smart_pointer::SmartPointer<T, Allocator>::value_type = float]':
Test_SmartPointer.hpp:238:9:   required from here
SmartPointer.hpp:88:19: error: no matching function for call to 'smart_pointer::exception::exception(char)'
             throw exception('a');
                   ^~~~~~~~~~~~~~
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 'char' 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 'char' 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
[печатать | |
]
(4 908 b)
0.074s 0.009s 10