Jaka literatura dla adepta C++?

0

Witam!
Aktualnie przerabiam książkę Język C++. Szkoła programowania (Stephen Prata). Jako że stronice powoli dobiegają końca mam pytanie - jaką literaturę "piękną" polecacie na dalsze nauki?
Problem jest w tym, że sam nie wiem co dalej. Ale mam kilka "punktów zaczepienia", o które chciałem się zapytać.

  • Czy brnąć dalej w C++? (Np. jakieś biblioteki typu Qt, itp?)
  • A może liznąć Javy albo C#? (Te technologie wydają się dosyć ciekawe.)
  • A może rzucić się na coś innego? (Niby znam trochę PHP, JS też gdzieniegdzie się liznęło, chociaż wolałbym coś z punktów wyżej).

Dlaczego literatura a nie kursy na internecie? Bo po pierwsze - dobre kursy są po angielsku. Więc nie dość, że musiałbym się uczyć, to dodatkowo musiałbym przetwarzać język obcy. Aż tak wielowątkowy nie jestem. Po drugie - nie ma to jak siąść sobie wygodnie w fotelu, przerobić jeden rozdział i dopiero po tym przejść na kompa i coś tam skompilować.

Wiem, że było wiele takich tematów, w każdym co innego radzą. A tam zaraz jeden z drugim rzucają się, co tam bardziej opłacalne, albo gdzie lepiej ogromne "projekta" wyczyniać. Powiem tak - programowanie traktuję jako hobby. (Chociaż z drugiej strony programista to niezły kawałek zajęcia ;)) Ale tejże nauki nie traktuję "biznesowo". Po prostu te tematy mnie ciekawią. I nie chcę się ograniczać do jednej rzeczy.

3

Najważniejsze jest to, co uznałeś za marny dodatek.

Skup się na nauce angielskiego.

3

Angielski w tej branży to absolutna podstawa i fundament. Może nauczysz się podstaw jakiegoś języka i 2-3 bibliotek z książek, ale na tym utkniesz. Jeśli coś nie będzie działało w kodzie (po stronie języka) - standard jest po angielsku. Jeśli nie będziesz ogarniał jakiejś funkcji z biblioteki - dokumentacje są po angielsku. Jeśli będziesz miał jakiś specyficzny problem - w większości przypadków ktoś już o to pytał na Stack Overflow - po angielsku.

Co do samych języków - C++ jest dosyć niewdzięczny do nauki na pierwszy ogień. W każdym razie jeśli nauczysz się dobrze jednego języka, to będziesz w stanie w kilka dni przerzucić się na większość innych (z mniejszym lub większym powodzeniem, ale jednak). A jeśli traktujesz to hobbystycznie, to najlepiej wypróbuj kilku skrajnie różnych technologii - czegoś z webdevu (np. PHP), czegoś natywnego (C++), czegoś interpretowanego (Java) i funkcyjnego (Haskell, Clojure czy coś takiego) i zobacz, w czym Ci się najprzyjemniej klepie. ;)

0

Traktuj dalej to hobbystycznie, a znam przypadki, że niektórym hobby w pewnym momencie samo przerodziło sie w dobrze prosperujący biznes. Jeśli mozesz się bawić, to się baw. Czy zmienić język? - nie wiem, jeśli Cię bawi, baw się dalej i stwórz jakieś programiki dla siebie i znajomych, a później będziesz więdział, czy czegoś Tobie brakuje, czy nie - inne języki i tak wypada choćby pobieżnie poznać, ale nie wszystko na raz.

0

Napisz jakiś program dla własnych potrzeb. Jak coś piszesz (cokolwiek co ma sens) to załóż repozytorium na GihHub i pokazuj światu. Napisz do tego najprostszą dokumentację. Tak jak ktoś wyżej napisał - podstawą jest angielski. Mniej czytania książek, a więcej czytania dokumentacji. W dobrej dokumentacji wszystko jest streszczone do minimum i nie ma setek strony owijania bawełny. Każdy język/technologia/biblioteki ma prostą strukturę co do nauki:

  1. hello world
  2. kolejne, proste przykłady do implementacji, modyfikacji
    po co czytać 40 stron książki o tym jak napisać hello world w języku X, jak można to zrobić na 1 dokumencie A4 PDF (2 strony)?

wydaje mi się, że książki są dobre do podstaw teoretycznych, fundamentów danego języka. Ale sam jak coś czytam to tylko dokumentację.

0

Jeśli chodzi o dokumentację danego języka, to ciężko jej nie zrozumieć. Wszystko ładnie opisane, zwięźle, na temat. Praktycznie zawsze jest jakaś tabelka, zamiast długich opisów. Tak samo na StackOverflow można zrozumieć większość łatwo, bo problemy z którymi się spotykałem do tej pory, można było rozwiązać paroma liniami kodu z prostym komentarzem. Jeśli chodzi o angielski, to takim "nieukiem" nie jestem, by nic nie rozumieć ;) W tym wypadku chodziło mi bardziej o długaśne kursy, mające po 1000 stron, gdzie wszystko jest po angielsku, i to w dodatku z "literackimi" słówkami i porównaniami. A "sucha" dokumentacja może być.

Odnośnie pisania - dużo w konsoli nie napiszę. Co prawda przećwiczę wszystkie podstawowe mechanizmy języka, ale mój wynik prac nie będzie nigdy "piękny". Dlatego też tutaj powstaje pytanie. Jakich bibliotek do pisania "okienek" się uczyć? Ostatnio widziałem poradnik Zelenta, jak to robić okienka w Builderze. Ale dla mnie to trochę śmieszny żart, ten cały program, jak i ten cały poradnik na YT.

@Websplash - pisałeś, że C++ jest "niewdzięczny". Co może więc mnie czekać niewdzięcznego, że będę "wyrywał" sobie potem włosy? :)
W PHP już dosyć popisałem, więc radzisz spróbować Javy? A więc tam będę powoli swoje kroki stawiał.

@NieGooglujMnie - początkującemu ciężko jest wyobrazić sobie, po co dana funkcja w dokumentacji jest. W takiej książce autor prowadzi czytelnika "za rączkę", przez co o wiele łatwiej przejść podstawy programowania. Więc do końca nie skreślał bym tego typu nauki.

0

Co do języka - jeśli nie masz problemów z rozumieniem dokumentacji i standardów to odpuściłbym sobie na Twoim miejscu książki, głównie z tych przyczyn, które wymienił NieGooglujMnie.
Co do C++ - crashe, crashe, do tego jeszcze trochę crashy, czasem skrajnie trudne do zdebugowania błędy wynikające ze złego wykorzystania wskaźników, wycieki pamięci. Jest trochę tych umilaczy i to potrafi mocno zniechęcić, póki się tego solidnie nie opanuje. :)
Co do okienek to polecam Qt, moim zdaniem jest bezkonkurencyjne.

0

@Websplash - poczęstowałbyś jakimiś linkami? Gdzie się tego Qt najlepiej uczyć? Czy Code::Blocks wystarczy do tego pisania?

Websplash napisał(a):

Co do języka - jeśli nie masz problemów z rozumieniem dokumentacji i standardów to odpuściłbym sobie na Twoim miejscu książki, głównie z tych przyczyn, które wymienił NieGooglujMnie.
Nie wiem, jakie książki panowie czytali, ale w tej, którą przerabiam nie ma aż takiego owijania w bawełnę. Jest tam za to pokazane wyraźnie, dlaczego dany element jest lepszy od innego i dlaczego go stosować. Wszystko na przykładach i z dobrym wytłumaczeniem.

1

Co do tego, jak c++ często skutecznie upodobnia ludzi do neonazistów:

  • Nie znajdziesz środowiska, które nie wybucha co jakiś czas jak granat
  • Jeśli już postanowisz działać bez środowiska, to sam kompilator zapewni Ci troche wybuchowej frajdy (fatal errory vc++, agresywne oprymalizacje gcc)
  • Standard to nie standard, to tylko wskazówka. Z takiego założenia wychodzi większość twórców kompilatorów
  • Jeśli zamierzasz używać surowych wskaźników, to jesteś głupi
  • Jeśli zamierzasz w ogóle nie używać wskaźników, to jesteś śmieszny i głupi
  • Jeśli zamierzasz pisać kod wykorzystujący mocno vtable, to prawdopodobnie minąłeś się z powołaniem;
  • Jeśli myślisz, że do pracy z C++ wystarczy znajomość C++ to jesteś śmieszny. Na całej drodze będą na ciebie czekać: język szablonów(nie bójmy się tego nazwać po imieniu), cmake-language, bash, batch, python i caly popis kreatywności twórców bibliotek
  • Jeśli nie potrafisz zorganizować sobie czasu podczas 10 minutowej kompilacji projektu, to źle trafiłeś
  • Jeśli myślisz, że wystarczy Ci standardowa biblioteka, to tłusty boost się z Ciebie śmieje. Razem z Qt
  • Jeśli jesteś fanem czystego OOP, to na wstępie dostaniesz w twarz mokrą skarpetą, jaką jest pardygmatowa mieszanka C++; ah, co do samego dziedziczenia, to wita CRTP.
  • Oh, lubisz krotki? Chodź, pokażę Ci krotkowe piekło
    [...]
2

@Zielony_Buszmen w oficjalnej dokumentacji jest trochę tutoriali obejmujących różne elementy frameworka, oprócz tego sama dokumentacja jest całkiem w porządku. Jeśli mimo wszystko wolisz książki, to na Helionie zdaje się są dwie pozycje z Qt (psst, na Allegro znacznie taniej) - miałem je w rękach i są w porządku jako wprowadzenie, bo Qt może na początku trochę przytłoczyć.

W Code::Blocks jak najbardziej możesz pisać, ale wymagałoby to trochę akrobacji z konfiguracją projektu. Do Qt jest dedykowany całkiem wygodny Qt Creator jako IDE.

0

@Websplash - chodziło ci o te dwie? http://helion.pl/ksiazki/c-i-qt-wprowadzenie-do-wzorcow-projektowych-wydanie-ii-alan-ezust-paul-ezust,cppqtw.htm oraz http://helion.pl/ksiazki/c-wykorzystaj-potege-aplikacji-graficznych-janusz-ganczarski-mariusz-owczarek,cppwyk.htm
(daję linki od wydawcy, by nikt mnie nie oskarżył o reklamowanie czegokolwiek, ale tak jak już wspominałeś, na internecie są lepsze oferty).

5

Zaczynałem od C++ i książki Praty, więc mogę się podzielić swoimi doświadczeniami.

  1. Jeżeli dajesz radę objąć umysłem elementy C++ to moim zdaniem nie ma lepszego języka na początek. Owszem jest w nim lekki mętlik, ale to zaleta. Z jednej strony jest dostęp do niższego poziomu, z drugiej OOP. Wiele do nauki, ale przy porządnym opanowaniu C++, inne języki są niesamowicie łatwe do opanowania. Składnia w stylu C jest obecna w wielu innych językach.
  2. Co do książki Praty to przedstawia ona C++ z perspektywy programisty C i sporo mówi o zagadnieniach/problemach charakterystycznych właśnie dla C. Niewiele jest o bibliotece standardowej. OOP jest pokazane od podszewki, ale mało nowocześnie. Ogólnie z tej książki nie nauczysz się jak dobrze wykorzystywać narzędzia, które daje nam C++. Autor uczy raczej, jak mało boleśnie migrować z C i wykorzystywać najważniejsze dobrodziejstwa C++.
  3. Przeczytanie i wykonanie zadań z tej książki powinno dać solidne podstawy i od tego momentu dokumentacja powinna być Twoim najlepszym przyjacielem.
  4. Tak jak inni wspominali, wymyśl sobie jakiś projekt i spróbuj go zrealizować. Nie bój się wracać do książki, jeśli czegoś zapomniałeś. Korzystaj z dokumentacji i spróbuj samodzielnie rozwiązywać problemy. Naucz się debugować programy, bo później, to czytanie komunikatów kompilatora i konfrontowanie ich z kodem nie wystarczy. Debugowanie to podstawa.
  5. Dobrze jest zapoznać się z konceptami biblioteki standardowej. GUI nie zając, nie ucieknie. Wiem, że programy konsolowe są brzydkie, ale to one pozwalają nauczyć się najważniejszych elementów tworzących rdzeń programu. GUI to jedynie dodatek, oprawa, wisienka na torcie. Owszem jest to integralna część programu, ale w konstruowaniu samego interfejsu niewiele jest teorii, nowych schematów, idei. Za to sporo suchych elementów, których zapamiętanie może być frustrujące.
  6. Nie bój się odejść od C++ i spróbować innego języka. Chcesz tworzyć coś namacalnego i ładnego to może czas spróbować web developerki.

Najważniejsze - Język Angielski.
Jego znajomość nie tylko otwiera niesamowitą ilość zasobów do nauki, tj. kursy, fora, dokumentacje. Bardziej istotne moim zdaniem jest rozumienie skrótowców tworzących nazwy poleceń. O wiele szybciej i na dłużej zapamiętasz pozornie oderwane od rzeczywistości nazwy, jeżeli poznasz ich językową genezę. Ze znajomością angielskiego, ASM wydaje się dziecinnie prosty do ogarnięcia. Uwierz mi.

I jeszcze jedno:
Im głębiej sięgniesz w zrozumieniu zagadnień, tym łatwiej załapiesz obecne wszędzie relacje między elementami języka. Zaczynanie od języków typowo OOP jest nietrafione. Owszem pozwala w krótkiej perspektywie czasowej zacząć pisać 'ładne' programy, ale za to dalekie od optymalnych, a nawet tragicznie ociężałe.

Na koniec polecam kurs CS50 na platformie edx.org dostępny dzięki Harvard University. Dla początkujących, ale za to niesamowicie ciekawy i zajmujący. Pozwala spróbować wszystkiego po trochu, koncentrując się przez większość czasu na języku C, a kończąc na HTML, CSS, SQL, PHP, JS. Moim zdaniem to najlepsze z możliwych ogólne zapoznanie z programowaniem. Projekty do wykonania są życiowe, a atmosfera płynąca z wykładów i innych materiałów wybitnie pozytywna. :)
https://www.edx.org/course/introduction-computer-science-harvardx-cs50x

0

Była w tym wątku mowa o debuggerach i logach, to ja powiem, że debuggery i logi to cudowna sprawa. Niejednokrotnie jest to jedyne narzędzie, które "coś więcej ci" powie na temat kodu. Ostatnio utknąłem na czymś przez 5 godzin, ale przez swoją głupotę (nieumiejętność korzystania z narzędzi). Po przeczytaniu log-a rozwiązałem problem w 2 minuty. Skończę ten projekt co teraz robię, to pierwsze co mam zamiar w "wolnym" czasie to szlifowanie i ćwiczenie debuggerów.

Wspominam o tym, bo akurat C++ ma pełno różnych debuggerów. Radzę zainteresować się tematem jak najwcześniej (przynajmniej z perspektywy tej rodziny języków).

0
NieGooglujMnie napisał(a):

Wspominam o tym, bo akurat C++ ma pełno różnych debuggerów. Radzę zainteresować się tematem jak najwcześniej (przynajmniej z perspektywy tej rodziny języków).

No to zaczynam się interesować :) Można prosić o jakieś linki/nakierowania?

0
Zielony_Buszmen napisał(a):
NieGooglujMnie napisał(a):

Wspominam o tym, bo akurat C++ ma pełno różnych debuggerów. Radzę zainteresować się tematem jak najwcześniej (przynajmniej z perspektywy tej rodziny języków).

No to zaczynam się interesować :) Można prosić o jakieś linki/nakierowania?

no google:
"best debuggers for c++"
"top 15 debuggers for c++"
chociażby to:
https://en.wikipedia.org/wiki/List_of_debuggers
http://stackoverflow.com/questions/79537/which-is-the-best-linux-c-c-debugger-or-front-end-to-gdb-to-help-teaching-pr
http://www.bt4.pl/kursy/cpp/jak-dzialaja-debugery/czesc-1/
http://www.informatyczne.waw.pl/komputerowe-ksiazki,8025247,debuggers,handbook.xhtml

ok, może ja mam jakieś zboczenie związane z ostatnimi wydarzeniami w tym co programuję, ale po prostu jest sobie język X. Ten język - jak jest popularny - to ma różne debuggery, które często wskazują na "różne przyczyny problemów". Najczęściej ludzie instalują jeden debugger i byle jak z niego korzystają. A prawda jest taka, że można uruchomić kilka różnych i porównywać wyniki (a wyniki mogą być różne).
Z mojej perspektywy: każde narzędzie, które powie ci coś więcej (komentarz, log) na temat kodu na którym aktualnie pracujesz jest wartościowe. I oczywiście komentarz/log musi być większy niż zwykły "internal error". Im więcej zebranych informacji na temat danego skrawka kodu, tym lepiej. Im bardziej szczegółowy komentarz, tym lepiej.

0

IMO żeby cośtam rozumieć z sesji debugowania to wypada przynajmniej te podstawy asma znać (a debugowanie na -Ox to już z pewnością ) bo co mu po tym że sobie wypisze stan rejestrów czy argumenty jak już z rozumieniem dlaczego dany rejestr w tym miejscu sie zwiększa a w innym zmniejsza (np. ESP) będzie krucho.
BTW. Co do debuggerów (pod linuxem) polecam GDB :- ). Teoretycznie jest bardzo toporny, ale jak sie z nim troche popracuje (podobna sprawa jak z vimem) to jest całkiem okej, i ma h4xiorski layout :D

0

nie trzeba od razu Linuxa, można na cygwinie :
http://stackoverflow.com/questions/1779247/how-to-add-gdb-to-cygwin

natomiast samych edytorów/vima/notepad++ nie polecam. Od razu najlepiej jest ogarniać jakieś fajne IDE dla danego języka i technologii. IDE mają wbudowane narzędzia, które pomagają. Wczoraj policzyłem przed snem i wyszło mi, że aktualnie korzystam z 12 narzędzi, z tego 7 mam wewnątrz IDE (Eclipse i pluginy).

0

Ah, tak od siebie dodam jeszcze drobną wskazówkę: naucz się czytać błędy kompilacji generowane przy szablonach.

Mini zadanie, przygotowane specjalnie dla Ciebie:
Na podstawie poniższego błędu kompilacji wydedukuj faktyczny problem w kodzie

In file included from ../TreeStructInfo_Test/src/Parser/general.cpp:3:
In file included from ../TreeStructInfo_Test/include/Parser/Scenarios/Configuration.hpp:14:
../TreeStructInfo_Test/include/Parser/Parser.hpp:32:41: error: no matching function for call to 'getline'
        while(collector.isCollecting && getline(istream, line))
                                        ^~~~~~~
../TreeStructInfo_Test/src/Parser/general.cpp:58:16: note: in instantiation of function template specialization 'TreeStructInfo::Parser<TreeStructInfo::StateMachine<TreeStructInfo::InterpretStrategiesResponsibilityChain<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >, Util::DictionaryTranslator> >::loadTreeFromTextStream<char const[14]>' requested here
        parser.loadTreeFromTextStream("notatxtstream");
               ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream:1633:1: note: candidate template ignored: could not match 'basic_istream<type-parameter-0-0, type-parameter-0-1>' against 'char const[14]'
getline(basic_istream<_CharT, _Traits>& __is,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream:1653:1: note: candidate template ignored: could not match 'basic_istream<type-parameter-0-0, type-parameter-0-1>' against 'char const[14]'
getline(basic_istream<_CharT, _Traits>&& __is,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream:1584:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
getline(basic_istream<_CharT, _Traits>& __is,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream:1644:1: note: candidate function template not viable: requires 3 arguments, but 2 were provided
getline(basic_istream<_CharT, _Traits>&& __is,
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/stdio.h:442:9: note: candidate function not viable: requires 3 arguments, but 2 were provided
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
        ^
In file included from ../TreeStructInfo_Test/src/Parser/general.cpp:3:
In file included from ../TreeStructInfo_Test/include/Parser/Scenarios/Configuration.hpp:6:
In file included from ../TreeStructInfo/include/DefaultTree.hpp:5:
In file included from ../TreeStructInfo/include/DefaultNode.hpp:5:
In file included from ../TreeStructInfo/include/DefaultAttribute.hpp:7:
../TreeStructInfo/include/Attribute.hpp:42:12: warning: field 'value' will be initialized after base 'commentable_base' (aka 'TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >') [-Wreorder]
        ): value(value_), commentable_base(comment_), nameable_base(name_){}
           ^
../TreeStructInfo_Test/include/CollectingTreats/AttributeTreat.hpp:30:17: note: in instantiation of member function 'TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >::Attribute' requested here
                attribute_type(
                ^
../TreeStructInfo_Test/include/CollectingTreats/AttributeTreat.hpp:67:13: note: in instantiation of member function 'TreeStructInfo::CollectingTreats::AttributeTreat<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > >::collect' requested here
            collect(name, value);
            ^
../TreeStructInfo_Test/include/InterpretStrategies/Attribute.hpp:13:59: note: in instantiation of function template specialization 'TreeStructInfo::CollectingTreats::AttributeTreat<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > >::prepareNext<std::__1::basic_string<char> >' requested here
            [&collector, &line]{ collector.attributeTreat.prepareNext(line); }
                                                          ^
../TreeStructInfo_Test/include/InterpretStrategies/TagsMapped.hpp:22:35: note: in instantiation of function template specialization 'TreeStructInfo::LineHandlingStrategies::attributeStrategy<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >' requested here
            {tag_type::Attribute, attributeStrategy<collector_type, string_type>},
                                  ^
In file included from ../TreeStructInfo_Test/src/Parser/general.cpp:3:
In file included from ../TreeStructInfo_Test/include/Parser/Scenarios/Configuration.hpp:20:
../TreeStructInfo_Test/include/Parser/StateMachine.hpp:135:16: warning: enumeration value 'Count' not handled in switch [-Wswitch]
        switch(getState()){
               ^
../TreeStructInfo_Test/include/Parser/StateMachine.hpp:75:34: note: in instantiation of member function 'TreeStructInfo::StateMachine<TreeStructInfo::InterpretStrategiesResponsibilityChain<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >, Util::DictionaryTranslator>::setState' requested here
        }, std::bind(&this_type::setState, std::ref(*this), std::placeholders::_1));
                                 ^
../TreeStructInfo_Test/include/Parser/StateMachine.hpp:88:9: note: in instantiation of function template specialization 'TreeStructInfo::StateMachine<TreeStructInfo::InterpretStrategiesResponsibilityChain<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >, Util::DictionaryTranslator>::wrapStates<std::__1::map<TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)>, std::__1::less<TreeStructInfo::StrategyTag>, std::__1::allocator<std::__1::pair<const TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)> > > > >' requested here
        wrapStates(dict);
        ^
../TreeStructInfo_Test/include/Parser/StateMachine.hpp:176:9: note: in instantiation of function template specialization 'TreeStructInfo::StateMachine<TreeStructInfo::InterpretStrategiesResponsibilityChain<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >, Util::DictionaryTranslator>::wrapStrategies<std::__1::map<TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)>, std::__1::less<TreeStructInfo::StrategyTag>, std::__1::allocator<std::__1::pair<const TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)> > > > >' requested here
        wrapStrategies(dict);
        ^
../TreeStructInfo_Test/include/Parser/Parser.hpp:26:50: note: in instantiation of function template specialization 'TreeStructInfo::StateMachine<TreeStructInfo::InterpretStrategiesResponsibilityChain<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >, Util::DictionaryTranslator>::StateMachine<std::__1::map<TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)>, std::__1::less<TreeStructInfo::StrategyTag>, std::__1::allocator<std::__1::pair<const TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)> > > > >' requested here
    Parser(const Dict &dict): collector(memory), machine(dict, collector){}
                                                 ^
../TreeStructInfo_Test/src/Parser/general.cpp:8:17: note: in instantiation of function template specialization 'TreeStructInfo::Parser<TreeStructInfo::StateMachine<TreeStructInfo::InterpretStrategiesResponsibilityChain<TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > >, std::__1::basic_string<char> >, Util::DictionaryTranslator> >::Parser<std::__1::map<TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)>, std::__1::less<TreeStructInfo::StrategyTag>, std::__1::allocator<std::__1::pair<const TreeStructInfo::StrategyTag, std::__1::function<bool (TreeStructInfo::Collector<TreeStructInfo::CollectedMemory<stack_template_type, deque_template_type, TreeStructInfo::Template::Tree<TreeStructInfo::Template::Node<nodes_map_type, attributes_map_type, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > >, TreeStructInfo::Ingredients::Versionable<std::__1::basic_string<char> > >, TreeStructInfo::Template::Attribute<std::__1::basic_string<char>, TreeStructInfo::Ingredients::Commentable<std::__1::basic_string<char> >, TreeStructInfo::Ingredients::Nameable<std::__1::basic_string<char> > > > > &, const std::__1::basic_string<char> &)> > > > >' requested here
    parser_type parser(dict);

Z góry mówię, że w zabawie nie uczestniczą obeznane osoby, których wprawne oko dość szybko (jeśli nie natychmiastowo) wyłapie podłożoną owcę :)

2

Panie drogi, ja dopiero się uczę. :P Gdybym się znał, nie pisałbym tutaj ;) Nie wiem o co chodzi.

To aż takie szablony można robić? Tak zagnieżdżone?

0

Oczywiście :)
Nie raz nie dwa nie pięć będziesz musiał wyciągać z tego informacje, czego żywy przykład masz w komentarzach, gdzie dla @Endrju czy @Satirev znaleźć problem to jak splunąć.

0

Mam takie pytanie na szybko. Czy deklarując destruktor czysto wirtualny virtual ~destr() =0; muszę go definiować? destr::~destr() {}

0

Tak, musisz.

Co to ma wspólnego z tym wątkiem? Jeden wątek = jedno pytanie.

0

Ma, ale dosyć okrężnie.

Były propozycje, by zacząć pisać kod, jak najwięcej. Więc zacząłem. I wywalało mi masę błędów, które poprawiałem. I tutaj się zatrzymałem, nie wiedziałem co dalej robić. Z racji tego, że to tylko takie małe pytanie, wrzuciłem je do tego tematu, i tyle :) Jeżeli mam wiele pytań tego typu (niewielkich), to do każdego mam zakładać nowy temat, czy może zrobić jakiś temat ogólny, gdzie "Buszmen ma problemy"?

1 użytkowników online, w tym zalogowanych: 0, gości: 1