Precompiled Headers in C++

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • Patreon ► / thecherno
    Instagram ► / thecherno
    Twitter ► / thecherno
    Discord ► thecherno.com/...
    Series Playlist ► thecherno.com/cpp
    Gear I use:
    -----------------
    BEST laptop for programming! ► geni.us/pakTES
    My FAVOURITE keyboard for programming! ► geni.us/zNhB
    FAVOURITE monitors for programming! ► geni.us/Ig6KBq
    MAIN Camera ► geni.us/t6xyDRO
    MAIN Lens ► geni.us/xGoDWT
    Second Camera ► geni.us/CYUQ
    Microphone ► geni.us/wqO6g7K

Komentáře • 279

  • @johanolssonn
    @johanolssonn Před 5 lety +223

    Aaaand done. I've watched every single episode of this series, almost 15 hours in total. C++ has never been clearer to me, you're so good at explaining! I have an exam in C++ in about a month and I'm sure I'll do just fine. Thank you, Cherno!

  • @domidivo
    @domidivo Před 4 lety +210

    I wish I could precompile all your c++ tutorials and load them directly to my memory lol.

  • @cicciobombo7496
    @cicciobombo7496 Před 5 lety +174

    Oh yes more c++ juice

  • @Buiscit1738
    @Buiscit1738 Před 5 lety +144

    g++ precompiled headers? Awesome videos. Joining the Patreon crew. Your videos are better than most c++ books I've read!

    • @passionfruit7617
      @passionfruit7617 Před 2 lety

      what's g++?

    • @jukit3906
      @jukit3906 Před 2 lety +2

      @@passionfruit7617 one of the main C++ compiler for non-Windows platform (with clang, although clang is more macOS while gcc and g++ more linux afaik)

    • @jukit3906
      @jukit3906 Před 2 lety +3

      @@passionfruit7617 It's stands for GNU C++ Compiler
      (GNU stands for GNU is Not Unix, and is an operating system that was **kinda** discontinued but its compiler collection (GCC) has become widespread)

    • @michaelswahla4927
      @michaelswahla4927 Před 2 lety

      g++ -> c++ compiler
      gcc -> c compiler

    • @rishabh5428
      @rishabh5428 Před 9 měsíci

      well g++ should be the same as gcc

  • @dawiy98
    @dawiy98 Před 5 lety +360

    thecherno > my college teacher :)

    • @pooria_garrett3020
      @pooria_garrett3020 Před 5 lety +11

      So you're free to worship him from now on :)

    • @neo-babylon7872
      @neo-babylon7872 Před 5 lety +18

      thecherno = mycollege

    • @theairaccumulator7144
      @theairaccumulator7144 Před 4 lety +5

      @@neo-babylon7872 nonono,
      the_cherno = my_collage;

    • @julk2701
      @julk2701 Před 4 lety +11

      @@theairaccumulator7144 How do you misspell college when you literally just read it

    • @hervesv9529
      @hervesv9529 Před 4 lety +6

      @@theairaccumulator7144 Wrong again, theCherno = myCollege; camelCasing FTW

  • @wikiejko
    @wikiejko Před 5 lety +46

    I've been following Your channel for like a year now, and I have to say, every video that you make is extremely high quality, both visually and content wise.

  • @mbrown1253
    @mbrown1253 Před 2 lety +7

    For those using g++, be sure to use the exact same g++ compile options for your precompiled headers as when you compile your project.
    Also if you're unsure whether your header or the PCH is being used when you compile your project, try adding the -H option when compiling your project. The -H compiler flag will print out which files are compiled, including each header.
    If the PCH is set up properly you should see a line like "! pch.h.gch" The exclamation point (!) indicates it was successful. If instead you see an X, that indicates there was a problem with the PCH.
    If you don't see this line and instead are presented with a wall of text printing out each header that was included in the compile, then your header was used instead of the PCH.

  • @Max-wk7cg
    @Max-wk7cg Před 5 lety +7

    I've been using them for a while and my first impression was that they are awesome, I just wasn't aware of their potential problems and I'm glad you mentioned them here. I'd like to add that if you are having trouble figuring out header file dependencies when using a precompiled header you should use the /showIncludes compile switch if you're using the msvc compiler. It will print out every header file dependency as they include each other. It's very very useful!

  • @muhammadtalhabaig4908
    @muhammadtalhabaig4908 Před 5 lety +15

    And thats it! I have completed this C++ series! And I have to say compared to what I learned in almost an year at my university, I learned more in a week following this series 😃. Thank you cherno for this amazing series and i am looking forward to watch game engine series and others as well! You are my fav teacher from now on 😁. keep up the great work, you are the best!

    • @Rose_Harmonic
      @Rose_Harmonic Před 3 lety +1

      I took a semester of c++ six years ago. I was surprised how quickly he eclipsed everything I learned.

  • @olliveraira6122
    @olliveraira6122 Před 3 lety +7

    18:42 precompiled headers with GCC
    (no fancy stuff lol, just a regular compilation)

  • @cargle7514
    @cargle7514 Před 5 lety +13

    Started using Windows Console Application template in VS and was wondering why the pch.h file was auto-created. Thanks for the information! This helped a lot.

  • @lucifer9033
    @lucifer9033 Před rokem +2

    this is awesome. thank you brother.

  • @serenitynow1978
    @serenitynow1978 Před 5 lety +9

    Dude, your vids kick ass++
    Thorough, informative, concise
    This time we get all three
    Thank you for your time and efforts

  • @drwisdom1
    @drwisdom1 Před 5 lety +1

    Ding! Ding! Ding! This is Mr. TheCherno's best video. Back in the 1980s/early 90s when computers were really slow, my Symantec C++ compiler had precompiled headers which really improved compilation speeds. Now computers are super fast so compiles don't take long, except in one instance - when compiling source that uses windows.h and is stored on a network drive rather than a local drive where it gets cached. I could have been using precompiled headers for the last 30 years and will now investigate if it will provide significant time savings.
    Of course I have some criticisms but they are small compared to the positives of this video. It took Mr. TheCherno 12 full minutes to say "you don't want to sit around waiting for constant code to compile, use precompiled headers to reduce wait times." I don't care about flipping screens and filling in blanks in Visual Studio, show me the command line so I don't have to research it.

  • @AmeshaSpentaArmaiti
    @AmeshaSpentaArmaiti Před 5 lety +23

    It hadn't occured to me that general C++ tutorials would still be coming alongside game engine tutorials.
    And I'm still learning new things. Why does c++ have so many "hidden" features? I've never heard of precompiled headers.

    • @Arganoid
      @Arganoid Před 5 lety +16

      It's technically not a feature of C++. It's a feature of certain compilers such MSVC.

  • @jeroenkoffeman9402
    @jeroenkoffeman9402 Před 4 lety +1

    here's an easy way in vs to force include your pch.h file in every source file:
    Configuration Properties -> C/C++ -> Advanced
    Type "cph.h" in the "Force Include File" field; this will make the visual studio compiler insert the header file at the beginning of each file without having to include it manually.

    • @TheDezmen3
      @TheDezmen3 Před 2 lety

      Tried, doesnt really work when u edit cpp file, it wont find stuff without including header manually

    • @jeroenkoffeman9402
      @jeroenkoffeman9402 Před 2 lety

      @@TheDezmen3 hmm for me it works, did you set it for "all configurations" ? Just checking

  • @zeevsolomonik6162
    @zeevsolomonik6162 Před 3 lety +1

    Modules are one of prominent features of standard C++20. They overcome the restrictions of header files and of the preprocessor usage. I would recommend to pay closer attention to this feature since it will eventually boost C++ packages management.

  •  Před 5 lety +30

    Correct me if I am wrong but the compiler does not compile the whole std::vector just because you included it. The only template code thats going to be compiled are those that you use (instantiate). So for example if I instantiate a vector and use the push_back method, the only code thats going to be generated are these 2 functions.

    • @edtExodus
      @edtExodus Před 5 lety +21

      The issue isn't necessarily the code generation, but figuring out what code needs to be generated. The pre-processor still needs to parse the entire code unit to figure out what actually needs to be compiled.

    • @sloth6765
      @sloth6765 Před 5 lety +3

      Wouldn't it be nice if every function was just available, and only included in the compile if called... How can I #include everything? I've got a fast computer.

    • @shadowmil
      @shadowmil Před 5 lety +7

      This is correct. Many compilers don't even parse the template (aside from finding the end) until it does get instantiate. Which can cause the awkward situation that certain syntax errors won't showup unless you instantiate.

  • @mohabmohamed5846
    @mohabmohamed5846 Před 5 lety +84

    a cmake video please D:

    • @GfastGao
      @GfastGao Před 5 lety +12

      Or say: Do this in a VS-Free way.

    • @VictorOrdu
      @VictorOrdu Před 5 lety +1

      @@GfastGao VS currently integrates cmake

    • @lummwastaken
      @lummwastaken Před měsícem

      You can add a PCH to a target in CMake using "target_precompile_headers" like so:
      target_precompile_headers( PUBLIC | PRIVATE | INTERFACE
      [["header_name_1.h"]]
      [["header_name_2.h"]]
      [["header_name_3.h"]]
      ...etc.
      )
      Only works if you pass in a compiled library or executable target.
      You can also reuse precompiled headers in later targets using the following:
      target_precompile_headers( REUSE_FROM )

  • @agfd5659
    @agfd5659 Před 5 lety +5

    Maybe you could make a video about unity builds and the differences (positives, negatives) compared to the more common way of building programs.

  • @annabelletrinh936
    @annabelletrinh936 Před 3 lety +1

    For XCode user:
    → Your pch file should be in the format -Prefix.pch
    - Go to Build Setting
    → Turn on
    → Add the path to your pch file in
    You don't need to include it in your *.cpp file, it's automatically included.

  • @Llourn
    @Llourn Před 5 lety +1

    What an awesome series of videos! I reviewed the whole series from start to finish over the last 3 days and looking forward to starting the OpenGL series next! Thanks a million for the fantastic material.

  • @oualice9410
    @oualice9410 Před 5 lety +3

    Thank you, Cherno, for making those wonderful videos. You are benefiting people and contributing to a better world!

  • @TheMrTape
    @TheMrTape Před 5 lety +2

    Absolutely perfect. Thanks for doing this.

  • @Mozartenhimer
    @Mozartenhimer Před 4 lety

    Ahhhhhhhh Adding this to my project felt good. Every tutorial ever always says not to use PCH, probably just to avoid the complications, but man alive, it was nice pch to my personal projects. That plus enabling multiprocessing builds in VS took my clean build time to 2.2 seconds. Was 5.7 seconds before this. That means a lot to me. I just love to compile all the time.

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p Před 3 lety

      hey, do you by any chance know how to enable multiprocessing from premake? I looked around but couldn't figure it out : /
      Nevermind, just found it, lol. In case anyone cares, it's very straightforward, just add:
      flags { "MultiProcessorCompile"}

  • @pu3zle
    @pu3zle Před 5 lety

    Just finished your C++ Course. I hope you'll keep posting more videos about C++ because I've learnt so much thanks to you. Don't abandon this series. :D

  • @LowLevelLemmy
    @LowLevelLemmy Před rokem +2

    cherno, more like cheryes

  •  Před 5 lety

    I was searching for a way to speed up building my codes, and PCH will probably have a huge impact. Thanks again for the tips and tricks.

  • @tomaskot9278
    @tomaskot9278 Před 5 lety

    I was scared of precompiled headers and I've always disabled them in the project settings. Now I see how simple they are in fact, so I'm definitely going to give them a try. Thank you very much!

  • @hichamwarryor3547
    @hichamwarryor3547 Před 3 lety +1

    Thanks so much

  • @rdappel
    @rdappel Před rokem

    I've been using them wrong for years lol. At my last job our tech lead had us throw everything in there. Having never really used them before, I didn't question it. Makes total sense now! Thanks for the video!

  • @HamzaHajeir
    @HamzaHajeir Před 5 lety +3

    Perfect series, Thank you Cherno :)
    Can you make a video about async calls. I have an embedded systems background and because MCU's are single-threaded, async calls are used, thus presence of async libraries, I am interested in developing libraries i use by using async calls.

  • @Debaser36
    @Debaser36 Před rokem +2

    When I use precompiled headers, I always still write the includes in the cpp files and just comment them out :)

  • @ekhidnis
    @ekhidnis Před 5 lety

    Phew, I've finished the series! Thank you a lot for sharing these and I wish you having a happy life there!

  • @chuthetai3011
    @chuthetai3011 Před 5 lety +3

    Thanks a lot 😁

  • @thatrandompalmtreeyousawon2068

    Man after following this series for a while I'm confident that I can get to building my first game in C++ soon

  • @kvitnat
    @kvitnat Před 4 lety

    never even heard about that
    i m a last year CS student from Ukraine and i just got my first job as c++ programmer and i'm pretty sure i wouldn't have passed all the tests and the interview if it wasn't for your c++ videos
    thanks a lot)

  • @laszlopaal9104
    @laszlopaal9104 Před 5 lety +1

    Can you please add video on how to write cache friendly code in C++? Bad and good design examples would be great.

  • @AntonioNoack
    @AntonioNoack Před 3 lety +3

    Hearing from them the first time, and I think they are great. It's a little sad, it's not done automatically by VS etc...

  • @MeeroSom
    @MeeroSom Před 3 lety

    This is 2021, August, I have never heard before about precompiled headers... Thank you for introducing them though, this is as if I would already be a kind of a member of a kind of a learning company, and you as a kind of senior co-worker explain the tricks of the old foxes. As if.

  • @georgea2835
    @georgea2835 Před 2 lety

    Stupid arm thing at the beginning of the videos is everything

  • @shavais33
    @shavais33 Před 4 lety +2

    Is there a way to use more than one precompiled header file in a MSVC++ project?
    It would be nice to separate the external headers that (almost) never change from internal headers that rarely change, but which do change from time to time. Then if/when I do have to change some rarely changed header, at least I wouldn't have to wait for all the external headers to recompile.
    Aside from combining translation units into one, are there any ways to further mitigate per translation unit compilation delays?
    I tend to end up with a ton of .h and .cpp files, and far more often than I'd expect, all or most of them end up getting recompiled when I run the build. In watching the compile, it definitely seems like there is a non-zero compile time cost associated with just having a translation unit at all, even if it has hardly anything in it. So I have this tendency to create "bundle" .h and .cpp files, that just #include a bunch of constituent .h and .cpp files, and then exclude those constituents from the build, so that way there are a lot fewer translation units to build. It definitely speeds up the build, but. I feel like there has to be a better way.
    Is there a good, succinct resource for reviewing the hows and wherefores of headerless C++ coding?
    Is there a good, succinct resource for reviewing the nuts and bolts of building Zero Overhead Abstractions?
    Recently I've been re-reading Bob Martin's book, Clean Code. One of the Big Ideas in it is to keep classes and functions really super small by dividing big ones up into smaller ones. I've tried that before, and I've kind of discarded the idea, because it seems like it's a lot more trouble than it's worth; but now that I have a lot more coding experience in general, I'm tempted to maybe re-approach it. But performance and efficiency are my foremost concerns, and build time is another big concern, and time spent coding tons of little classes and functions is another matter that kind of still gives me pause about it all. I think I need to better understand how I can
    - avoid having to maintain separate declarations/headers for every little constituent class and class member,
    - place their scopes into physical hierarchies (since named functions can't be nested in C++) without proliferating too many namespaces / long ns chains,
    - organize and control their individual scopes, both cognitively and in terms of their impact on the build, and
    - build zero-overhead abstractions.
    There's a fair bit that I already know about all that, but. If there isn't more to know than I know, then I guess I'm still kind of feeling like trying to really make super small classes and class members in the way Mr Martin talks about isn't really worth it in C++.

  • @drop0ne_f20
    @drop0ne_f20 Před 2 lety

    0:04 Hello The Cherno! Welcome back to my PC. :) LOL I made a funny!
    FYI I am aware I am not funny but that will never stop me :)

  • @UlyssesAza
    @UlyssesAza Před 4 lety

    This is genuinely a great video thanks a lot.

  • @marotonin7620
    @marotonin7620 Před 3 lety +2

    How can I add precompiled header file into a file inside subdirectory? if I use "../pch.h" it won't recognize it it needs to be "pch.h"

  • @mrinmoybanik5598
    @mrinmoybanik5598 Před 2 lety +1

    Can you make a video on how to precompile .hpp headers from command prompt?

  • @澳洲程序员大卫
    @澳洲程序员大卫 Před 3 lety

    Well explained, thanks!

  • @omar_alzeer
    @omar_alzeer Před 2 lety

    You are a legend !!

  • @baconsledge
    @baconsledge Před 5 lety

    Excellent video series!

  • @razvanfilea8076
    @razvanfilea8076 Před 5 lety +47

    I think he said "Right?" about 40 times lol

  • @Tel29767
    @Tel29767 Před 5 lety

    Love your series. Could you do a video on file input/output at some point as well please?

  • @marcpanther7924
    @marcpanther7924 Před 5 lety

    I love the People's Elbow gesture in the beginning

  • @xingsir
    @xingsir Před 5 lety

    Thank you. I really like this kind of video. Please more :)

  • @adamhendry945
    @adamhendry945 Před rokem

    Can you please also do a video on the pIMPL idiom/method and on alignment and padding?

  • @user-hw7iy3jc3i
    @user-hw7iy3jc3i Před 5 lety

    Thanks, cherno! We are finsihed this courses!

  • @foomoo1088
    @foomoo1088 Před 2 lety

    I don’t use them for the reasons mentioned . I like keeping track of my dependencies, don’t use STL, and use a “game module” approach. True, my project is not super big yet but so far the modular design and limiting dependencies gives quick compile times.

    • @foomoo1088
      @foomoo1088 Před 2 lety

      Unreal engine also moved to the “include what you use” philosophy a while ago (similar approach in my personal engine)

    • @thoaxm6687
      @thoaxm6687 Před rokem

      @@foomoo1088 CMake's target_precompile_headers() force includes the PCH into the translation units so source files can stay the "include what you use" way. (Still means you shouldn't bloat the PCH with absolutely everything, of course).

  • @huiguo1489
    @huiguo1489 Před 4 lety +1

    I wonder how to use this trick in a CMake project. Is there an example?

    • @xrafter
      @xrafter Před 4 lety

      I have make that work will but cmake i don't know

  • @scottnivens9936
    @scottnivens9936 Před 2 lety

    Why am I learning about PCH's only now?! I managed to reduce the time for a full compile by >75%! WOW! Thanks!

  • @esben181
    @esben181 Před 5 lety +1

    A video in the middle of the week! What an amazing surprise :D Thank you

  • @dijkstra4678
    @dijkstra4678 Před 2 lety

    very informative

  • @mihirluthra7762
    @mihirluthra7762 Před 3 lety

    Glad I came across your channel :)

  • @anthonyhalim926
    @anthonyhalim926 Před 5 lety

    Would love to see a video about typedef, typename, and using keywords! Love the videos

  • @veeecos
    @veeecos Před 5 lety +1

    Could you please do a video on custom data structures next ?. I know you had mentioned them a while ago.

  • @Xx_McJasper_xX
    @Xx_McJasper_xX Před 3 lety +1

    First time I've heard of it. This is one of the problems with university education. You learn tons of theory but never hear about the practical tools/tips/tricks that professionals actually need.

  • @carlodiferrante9577
    @carlodiferrante9577 Před 5 lety +1

    What about compiler cache? looks like a simpler and more ffective solution.

    • @HiAdrian
      @HiAdrian Před 5 lety

      Yes, I think a compiler cache is a much better solution!

  • @victorz7748
    @victorz7748 Před 2 lety

    This is definitely a looooooooooooooooong hello world 13:29

  • @DaveChurchill
    @DaveChurchill Před 5 lety

    I was really hoping that you would somehow put this into the premake file, that would be awesome

  • @hiraasif4227
    @hiraasif4227 Před 4 lety

    When are you going to make video on "File Handling in C++" , I can't find any fruitful video on that!
    Please make a video on that!!
    Moreover , I just love the way you explain things and you are really my teacher now a days.
    I have my final tomorrow of OOP, and will pass it just because of you!
    Thank You Sooooo Much!
    Have a Nice Day!

  • @simonmarchand1818
    @simonmarchand1818 Před 5 lety +4

    Hi Cherno, do you work on unreal engine and will you do some video about it ?
    Thx for this C++ series as well as the game engine one, it is very useful in my studies.

    • @kplays_6000
      @kplays_6000 Před 5 lety +1

      No, he doesn't

    • @esben181
      @esben181 Před 5 lety

      I believe Udemy have some excellent courses on that topic if you are willing to spend a few bucks.

    • @kplays_6000
      @kplays_6000 Před 5 lety +1

      @@esben181 Don't bother with Udemy, just look around on CZcams and use the official tutorials, there's plenty of free content out there.

    • @shaunyitisme3293
      @shaunyitisme3293 Před 5 lety

      @@esben181 Thx but I just like the quality of Cherno's video and wanted to know about future projects.

    • @jcdentonunatco
      @jcdentonunatco Před 5 lety

      The Unreal C++ course on Udemy by Ben Tristem is really good, and very cheap, I definitely recommend it.

  • @mohammedbadaway7490
    @mohammedbadaway7490 Před 4 lety

    Thank you

  • @nullnull6032
    @nullnull6032 Před 4 lety

    very cool

  • @feraudyh
    @feraudyh Před 5 lety

    Best explanation I have ever seen.

  • @brod515
    @brod515 Před 5 lety

    Wow! I knew there was search a thing as pre-compiled headers just didn't really know what they did.

  • @electroturi
    @electroturi Před 5 lety

    Can you have several pre-compiled headers in one project? Maybe like that you can pre-compile external dependencies in one PCH and then have your own code (or part of it) in a different PCH. This could be useful, no?

    • @benhetland576
      @benhetland576 Před 4 lety

      @electroturi Yes, you can have several pch in the same project, but perhaps not in the way you are thinking. AFAIK in Visual Studio you can only make use of one pch in each cpp file. There is a caveat too, and that is that the #include "pch.h" must be the first effective codeline in that cpp file. Everything before that line is actually completely ignored by the compiler! If the lines are just comments, that's no problem of course, but if you accidentally put something else important there, you will eventually be bitten ... My guess is that the implementation is simply such that the compiler just loads its entire internal state from the pch, then continues compiling from the line after the include pch.h. Whether it is similar in g++ and clang, I don't know, but that would be the reason you cannot load several pch in the same cpp with MSVC at least.

  • @lnx648
    @lnx648 Před 3 lety

    Potentially stupid question:
    if I add a lot of files into the the precompiled header, and then I include the pre compiled header, am I not including a lot of potentially useless code into every file of my project and yes speeding up the compile time but also increasing the final executable file size?
    Will turning off precompiled headers for say a release build make the compiler ignore included files that are not being used, therefore I can expect a larger executable file during development, but a smaller executable in release?
    Or the difference in sizes is so minimal I can avoid caring at all, considering large projects too of course.

  • @Arganoid
    @Arganoid Před 5 lety

    They used to lead to project folders taking up huge amounts of disk space (in Visual Studio, at least) - eg a simple Hello World app could take up gigabytes. Is this still the case?

  • @michaelpacheco7421
    @michaelpacheco7421 Před 5 lety

    Waiting for more videos! CMake is a good choice.

  •  Před 5 lety

    Make a video about set and unordered_set in C++. I need them for a project at my university. Especially how to implement them for a custom class/structure. Or, maybe give me a good source from where to learn this, because I've had hard times trying to implement unordered_set for my custom structure.

  • @abdulelahaljeffery6234

    compiling .h file with clang++ gives a warning:
    clang-6.0: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
    .hpp compiles fine.

  • @samziggler7837
    @samziggler7837 Před 4 lety

    New to me, it's a go for it to me

  • @kombuchamp
    @kombuchamp Před 5 lety

    Great video!

  • @oblivionronin
    @oblivionronin Před 5 lety +1

    @TheChernoProject love your videos as usual, super awesome, ill definitly try this !
    personally i like to do a Makefile with the file dependency's and compile all my .cpp and .h files into object files and link them at the end of the makefile sequence, so basicly make only recompiles the ones that have changes and relink them, much faster than normal compiling.

  • @inesdammak2928
    @inesdammak2928 Před 5 lety +1

    12:11 where it really starts. And thanks a lot you were super helpful.

  • @norb3695
    @norb3695 Před rokem

    19:10 how did that thing generate 117 megabytes in such a small time what???

  • @shikharchaudhary6984
    @shikharchaudhary6984 Před 4 lety

    amazing video

  • @rashidabbasi6035
    @rashidabbasi6035 Před 5 lety

    you video are so excellent

  • @h.hristov
    @h.hristov Před 5 lety

    Cover move semantics next yes

  • @a_cats
    @a_cats Před 4 měsíci

    Clangd complains that I'm not using the header directly, should I just disable that warning or is there a standard way to deal with this? The fact that it's warning at all makes me feel like there's a convention for pchs that I'm not aware of

  • @dibyaranjanmishra4272
    @dibyaranjanmishra4272 Před 5 lety

    Amazing!!

  • @yellowlegend245
    @yellowlegend245 Před 5 lety

    another question,
    1. cant we have different pch.h file for different projects
    2. i see it makes difference on development time, does it have any performance on final executables also? or is that same
    No need to say, that your explanation is awesome, better than many classroom teachers.

  • @Drtsaga
    @Drtsaga Před 5 lety +7

    11:20 the saliva made its entrance lol

    • @pako_powr
      @pako_powr Před 5 lety

      It happens to the best of us lol

  • @ali51717
    @ali51717 Před 3 lety

    from 8 to 1.5 sec.
    that was my experience with pch, but it took me hours to figure out how to use them lol.

  • @ajinkyax
    @ajinkyax Před 3 lety

    is there a way to do same with a CMake project ? Those properties you showed wont open in Visual Studio 2019 for a CMake project.

  • @AustinJerry
    @AustinJerry Před 5 lety +1

    Hey, Cherno can you make a video on maps?

  • @kalelalves
    @kalelalves Před 2 lety

    Before anything... Amazing videos. I love the way you explain stuff man. You're really good at that.
    11:50 i know this is pretty old, and I agree that PCHs area must for those kinds of libs, but dude, you keep saying you don't want to recompile it everytime, regarding the STL... And that not entirely false, cause you end up recompiling symbol references you use and parsing the h files into your translation unities,, but the library is already compiled in the c++ runtime, or other libs/DLLs you use. So it's also not all true that you end up recompiling all that stuff. If you would have to, then you would see the amount of time that that takes, it's absurdly larger and longer than just parsing headers... That's one of the main header/source separation reasons. Unless off course you use some bad lib that needless defines a lot of stuff in headers.
    I'm certain that you know all that, but saying that might be confusing for the people that does not have good knowledge about c++ or linking in general and possibly give them a bad ideia of what that whole system actually does.
    I just think that it's something that should be mentioned, although, I'm not as good at teaching as you are, so I might be wrong as well haha, and this is something people shouldn't have to know at first, like how you get to physics formulas when you first learns physics cause you have no idea of integral calculus, limits, and so actually is.
    I still think it should though. 😂

  • @louisramirez975
    @louisramirez975 Před 5 lety

    Is it possible to make a vid about implementing the big five in c++ when you have a pointer in a class as a data member

  • @CreativeOven
    @CreativeOven Před 5 lety

    i love precompiled headers i hate waiting when compiling

  • @StasonST19
    @StasonST19 Před rokem

    nice

  • @fossforever512
    @fossforever512 Před 5 lety

    This is nice

  • @gowtham236
    @gowtham236 Před 4 lety

    Didn't know about this feature.