C++ 11: User Defined Literals

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 14

  • @MsJavaWolf
    @MsJavaWolf 5 лет назад +11

    Great video, I want to add one thing:
    As correctly done in the video, all user defined literals should start with an underscore. The standard library reserves all suffixes without an underscore, so if you use names without an underscore the standard library might use the same literals in future versions and break your code.

  • @ldxyz-s1e
    @ldxyz-s1e 9 лет назад +5

    3:18 literal calculations are done at compile-time, so no run-time cost.
    6:30 constexpr
    8:47

  • @JonahEadie
    @JonahEadie 11 лет назад +5

    I love your tutorials Bo! They're all crazy helpful.

  • @DAToft
    @DAToft 7 лет назад +2

    Great tutorial! So much information, and so simply explained :)

  • @thestarinthesky_
    @thestarinthesky_ Год назад

    Love your tutorials! Awesome!

  • @hodulakr
    @hodulakr 6 лет назад +1

    Quick and simple, very helpful :) Thank you.

  • @educate9946
    @educate9946 4 года назад

    Good intro! Thank you!

  • @vicez_
    @vicez_ 7 лет назад

    Awesome video, thank you!

  • @kevinluu7833
    @kevinluu7833 8 лет назад +3

    I would like to ask you the below question:
    About the example:
    int operator "" _bin (const char* str, size_t L) {
    ...
    for (int i=0; i

    • @sumanthkavikondala1036
      @sumanthkavikondala1036 6 лет назад

      u r right how could it pass size automatically

    • @VivekYadav-ds8oz
      @VivekYadav-ds8oz 5 лет назад +2

      @@sumanthkavikondala1036 I was also in doubt until I saw the last screen which showed the supported parameters.
      It clearly showed that const char* had to be passed around with a std::size_t, meaning compiler does indeed do that itself...

  • @about2mount
    @about2mount 4 года назад +1

    At 2:30 what do mean people still mess up the units? hahaha. Lets be clear of something---All computers use and are fully developed and designed with the American Standard Measurement Systems and not the Metric System. So in reply to a standard for all programmers you have it backwards and I will explain why:
    1. The metric system is based on 1-10, Standard is based on 1-9--(the computer has no 0).
    2. All variable types are based on Standard as 4, 8, 16, 32, 64, plus by 8's.
    3. All chip-sets are based on Standard as 8, 16, 32, 64, plus by 8's.
    4. All Micro-chips are based on Standard as 8, 16, 32, 64 plus by 8's.
    5. All Ports are all based on Standard as 8, 16, 32, 64 plus by 8's.
    6. All computer,s math in the stack, heap and registers are all done in American Standards of 8. 16, 32, 64 plus by 8's.
    8. The Metric System has to be programmed into computers through software using the American Standard likewise. Why because the computer does not recognize 0. Also the reason everything in them is done in fractions of 1/8, 1/16, 1/32, 1/64 plus is because fractions are Standard not metric.
    9. Why are all computer internals all in Standard multiple fractions of 8's? Because 1-9 are in fact only 8 numbers in a computer stack array as.....
    0,1,2,3,4,5,6,7,8
    1,2,3,4,5,6,7,8,9
    In closing---The whole reason C++ has a "Standard" is because it is the "Standard". Lol No offence !

    • @267praveen
      @267praveen 2 года назад +1

      No offense but don't know what are you trying to say. Unfortunately you are not Bo !!!

  • @BoQianTheProgrammer
    @BoQianTheProgrammer  11 лет назад +2

    I am using netbeans