In file included from main.cpp:1:0:
solution.h:4:8: error: 'vector' in namespace 'std' does not name a template type
std::vector<iterator_traits<Iter>::value_type> elements;
^~~~~~
solution.h:6:41: error: ISO C++ forbids declaration of 'Slicer' with no type [-fpermissive]
explicit Slicer(Iter begin, Iter end) {
^
solution.h:6:5: error: only declarations of constructors and conversion operators can be 'explicit'
explicit Slicer(Iter begin, Iter end) {
^~~~~~~~
solution.h:13:5: error: 'size_t' does not name a type; did you mean '__size_t'?
size_t size() const {
^~~~~~
__size_t
solution.h:28:2: error: expected ';' after class definition
}
^
;
solution.h: In member function 'int Page<Iter>::Slicer(Iter, Iter)':
solution.h:8:13: error: 'elements' was not declared in this scope
elements.push_back(*begin);
^~~~~~~~
solution.h:11:5: error: no return statement in function returning non-void [-Werror=return-type]
}
^
solution.h: In member function 'auto Page<Iter>::get()':
solution.h:18:16: error: 'elements' was not declared in this scope
return elements;
^~~~~~~~
solution.h: In member function 'auto Page<Iter>::begin()':
solution.h:22:16: error: 'elements' was not declared in this scope
return elements.begin();
^~~~~~~~
solution.h: In member function 'auto Page<Iter>::end()':
solution.h:26:16: error: 'elements' was not declared in this scope
return elements.end();
^~~~~~~~
solution.h: At global scope:
solution.h:33:8: error: 'vector' in namespace 'std' does not name a template type
std::vector<Page> pages;
^~~~~~
solution.h:45:5: error: 'size_t' does not name a type; did you mean '__size_t'?
size_t size() const {
^~~~~~
__size_t
solution.h:56:2: error: expected ';' after class definition
}
^
;
solution.h: In constructor 'Slicer<Iter>::Slicer(Iter, Iter, int)':
solution.h:37:21: error: 'distance' is not a member of 'std'
while (std::distance(begin, end) >= page_size) {
^~~~~~~~
solution.h:38:13: error: 'pages' was not declared in this scope
pages.push_back(Page(begin, i).get());
^~~~~
solution.h:38:13: note: suggested alternative: 'Page'
pages.push_back(Page(begin, i).get());
^~~~~
Page
solution.h:42:9: error: 'pages' was not declared in this scope
pages.push_back(Page(begin, end).get());
^~~~~
solution.h:42:9: note: suggested alternative: 'Page'
pages.push_back(Page(begin, end).get());
^~~~~
Page
solution.h: In member function 'auto Slicer<Iter>::begin()':
solution.h:50:16: error: 'pages' was not declared in this scope
return pages.begin();
^~~~~
solution.h:50:16: note: suggested alternative: 'Page'
return pages.begin();
^~~~~
Page
solution.h: In member function 'auto Slicer<Iter>::end()':
solution.h:54:16: error: 'pages' was not declared in this scope
return pages.end();
^~~~~
solution.h:54:16: note: suggested alternative: 'Page'
return pages.end();
^~~~~
Page
solution.h: At global scope:
solution.h:58:1: error: expected unqualified-id before '<' token
< template T >
^
In file included from /usr/include/c++/7/cassert:44:0,
from main.cpp:12:
main.cpp: In function 'void TestPageCounts()':
main.cpp:25:10: error: 'Slice' was not declared in this scope
assert(Slice(v, 1).size() == v.size());
^
main.cpp:25:10: note: suggested alternative: 'Slicer'
main.cpp: In function 'void TestLooping()':
main.cpp:40:27: error: 'void __for_begin' has incomplete type
for (const auto& page : slice_v) {
^~~~~~~
main.cpp:40:27: error: 'void __for_end' has incomplete type
main.cpp:41:18: error: unable to deduce 'auto&&' from 'page'
for (int x : page) {
^~~~
main.cpp: In function 'void TestModification()':
main.cpp:52:20: error: 'Slice' was not declared in this scope
for (auto page : Slice(vs, 2)) {
^~~~~
main.cpp:52:20: note: suggested alternative: 'Slicer'
for (auto page : Slice(vs, 2)) {
^~~~~
Slicer
main.cpp:53:23: error: unable to deduce 'auto&&' from 'page'
for (auto& word : page) {
^~~~
main.cpp: In function 'void TestPageSizes()':
main.cpp:67:27: error: 'void __for_begin' has incomplete type
for (const auto& page : letters_slices) {
^~~~~~~~~~~~~~
main.cpp:67:27: error: 'void __for_end' has incomplete type
main.cpp: In function 'void TestConstContainer()':
main.cpp:79:27: error: 'Slice' was not declared in this scope
for (const auto& page : Slice(letters, 10)) {
^~~~~
main.cpp:79:27: note: suggested alternative: 'Slicer'
for (const auto& page : Slice(letters, 10)) {
^~~~~
Slicer
main.cpp: In function 'void TestPagination()':
main.cpp:92:33: error: 'Slice' was not declared in this scope
for (const auto& split_by_9 : Slice(v, 9)) {
^~~~~
main.cpp:92:33: note: suggested alternative: 'Slicer'
for (const auto& split_by_9 : Slice(v, 9)) {
^~~~~
Slicer
main.cpp:95:23: error: unable to deduce 'auto&&' from 'split_by_4'
for (int item : split_by_4) {
^~~~~~~~~~
cc1plus: all warnings being treated as errors
|