i'm glad you discouraged the use of using Auto for type inference. I had a software engineer intern interview for a position and my feedback to him was to avoid using Auto so much, his code was full of it. Also liberal use of Double, when float would work just as well for the application, and take less space (and time, for embedded systems).
@yxlxfxf3 жыл бұрын
btw, there is a simpler method of decomposing tuples nowadays called structured bindings: auto t = std::make_tuple(1, "hello"); auto [x, y] = t; // x==1, y=="hello" auto &[x, y] = t; // if you want to decompose by reference
@raghavgupta61863 жыл бұрын
Thanks 🙏
@kashtonmario13793 жыл бұрын
i guess it is kinda off topic but do anybody know of a good site to stream newly released series online ?
@robertodamian75443 жыл бұрын
@Kashton Mario I use FlixZone. Just google for it :)
@thatisthatoof3 жыл бұрын
Cool. What situations would require the decomposition by reference?
@yxlxfxf3 жыл бұрын
@@thatisthatoof when you want to modify the contents of the tuple by assigning each element to a reference
@solarsystem84243 жыл бұрын
In newer versions of the C++ standard you can get the value of a variable in a tuple by specifying the type. It makes the code more readable and understandable, IMO. That only works though when the specified variable is the only variable of that type.
@AnonyoZarifAkand3 жыл бұрын
I use this series to review C++ topics every night before I go to sleep. :P Edit: cuz I don't use C++ frequently
@dimasveliz67453 жыл бұрын
Thanks Tim, fantastic as usual! I'm gonna ask after reading many comments: Am i the only one person surprised by the Tie function?? 😳 1)How is that function taking a value type variable, and magically inside of it, assigns its value??? 2) why is a call to a function on the left side and not on the right? Is that then a function? If you or anyone could provide an explanation for that, I'll highly appreciate it
@QuangLe-qk3nv9 ай бұрын
Tim: I call it Tuple other people: "toople" me: Turtle.
@softwhere073 жыл бұрын
Oh that was great. This was very interesting and I understood it well. Thank you for teaching us. I can see there would be a lot of uses for this. Seeing that I use it often when dealing with python.
@raghavgupta61863 жыл бұрын
Great content ^_^ btw definition: simply means the allocation of memory for a variable and declaration: means telling the compiler about the type of variable, variable, no memory is allocated. in CPP, both declaration and definition happen simultaneously,(but when we use extern storage class only the declaration is done). Just for the info :)
@TechWithTim3 жыл бұрын
Thank you!!
@doaamahmoud71353 жыл бұрын
اللهم صل على نبينا محمد وعلى اله وصحبه اجمعين ❤️🥰
@RekhaRani-mu9od3 жыл бұрын
I can't read Urdu lang so please translate it to English or hindi
@doaamahmoud71353 жыл бұрын
I say, O God, bless our prophet Muhammad and his family and all his companions.🥰
@RekhaRani-mu9od3 жыл бұрын
@@doaamahmoud7135 thanks for translating
@doaamahmoud71353 жыл бұрын
Forgive, thank God.😊
@doaamahmoud71353 жыл бұрын
@@RekhaRani-mu9od can you help me Where is the mistake? using namespace std; //Compiler version g++ 6.3.0 int main() { int count=1; For( count=1;count
@keshav.mishra3 жыл бұрын
Hey Tim can you help me What should I choose i3 9 generation. Or i5 5-6 generation As high school student
@lifesgood50653 жыл бұрын
i3 9th gen
@AbhishekBM3 жыл бұрын
You have to be a little more specific. If the clock speed, cache, amount of cores etc. are almost the same, I'd go with i3 9th gen.
@madboy24763 жыл бұрын
c++ is a valuable language to learn for engineers and such. So stop the hate.
@abrarmasumabir38093 жыл бұрын
plz cover literally everything on c++ and make some project videos on it like you made pygames for python...
@OutlawJackC3 жыл бұрын
If you want literally EVERYthing covered in c++ and don't mind if its not Tim, then The Cherno has a super in depth playlist with hours of videos which I used to learn the language But I dont think he has a specific project tutorial using c++ other than short examples to demonstrate how some features are used
@yourdadsbestfriend71013 жыл бұрын
bro you are amazing
@erickcardozo4623 жыл бұрын
Why angle brackets for indexing? How tf it works? I thought angle brackets were for types, for templates.
@yxlxfxf3 жыл бұрын
You can put non-type parameters in templates as well. The reason std::tuple needs such indexing is because it has a very complex implementation based on chained inheritance, so they have a special helper function for accessing its members. C++ is just not made for having containers with arbitrary data types, like python, so you have to use template tricks for that.
@djupstaten2328 Жыл бұрын
@@yxlxfxf the coolest trick would be to make tuples not need tricks. The std::people have no excuse. C++ Tuples atm are just poor design.
@yxlxfxf Жыл бұрын
@@djupstaten2328 I'm sure you are smarter than the people who standardize C++. Please describe me how you would implement an efficient, generic tuple type in C++, I'd like to amuse myself
@manipurihunabopa Жыл бұрын
I don't know when i should use tuples. What are some of the useful situations to use it? Specify on that please
@UnofficialXuno4 ай бұрын
just solve problems or build projects and the time for the use of it will come
@harshitpandit1883 жыл бұрын
if we use strings instead of int for x,y while decomposing the tuple, we get emojis. it worked for me atleast you guys should try that out :)
@subee1282 жыл бұрын
Thanks
@tanmayunhale13192 жыл бұрын
tuple and map is not working the way its supposed to on my device. what is the fix?
@jrupp28233 жыл бұрын
i needed you in college lmao i never understood these
@Davidku6323 жыл бұрын
What theme are you using in vscode? I really like it
@OutlawJackC3 жыл бұрын
Tim is using Sublime Text not VSC Im hoping that was a serious comment ortherwise im going to get roasted for not knowing if its a joke
@Davidku6323 жыл бұрын
I didn t meant for this video. I Just saw it in other videos and asked it here
@warboom1983 жыл бұрын
i cant use tuples on mc for some reason. Says it does not recognize it
@warboom1983 жыл бұрын
@Peterolen it kind of works now
@t0talslag3 жыл бұрын
Hi witch IDE are you using i like the interface
@ag88301 Жыл бұрын
its sublime text
@codex91173 жыл бұрын
Is it possible to loop through a tuple (for example to cout it's values)?
@djupstaten2328 Жыл бұрын
It is but don't be fooled into thinking you can use Get() for that. It will only accept const ints (size_t). :D Instead you will have to use a lambda workaround such as this: std::apply([&whatever](auto const& ...extractedelem) { ((functionthatdoesthings(extractedelem, whatever),...)); }, yourtuple);
@Jfti92002 жыл бұрын
Help me with my survey.❤ What do you guys personally want the features of your device but it is not available yet? Or what you want to bring change in your device? I hope this is understandable🙏
@MusicalGeniusBar3 жыл бұрын
So a tuple is like a class ?
@OutlawJackC3 жыл бұрын
tuple is from the std namespace Without 'using namespace std;' at the top you would need to do 'std::tuple' instead of 'tuple' which is saying to go to the 'tuple' class inside the 'std' namespace
@OutlawJackC3 жыл бұрын
5:55 just wanna complain again about u saying its a float when actually its a double U need to use f for it to be a float 24.3f is a float 24.3 is a double that gets implicitly converted to a float And to prove that they are actually different u can use auto and sizeof and they should be different auto var1 = 24.3; auto var2 = 24.3f; cout
@s.dh293 жыл бұрын
B4 100 views 😊
@ayush.kumar.139073 жыл бұрын
tuple is similar to pair, rather than array or vector
@Gaelrenaultdu063 жыл бұрын
Tuples can be helpful, but the fact that iterating through them is so difficult, their field of use is to me, amazingly reduced...
@oximas-oe9vf Жыл бұрын
lol
@melissaleigh30133 жыл бұрын
Tim youre always handsome
@HamiltonGJr3 жыл бұрын
Pronunciación of tuples? Google Is our friend! It is something like 2Pauls...
@thecscontent51103 жыл бұрын
I also do videos about programming!😁
@TheDezmen33 жыл бұрын
Soooo... it's basically a structure
@shubhrajit2117 Жыл бұрын
Having learnt python before, this syntax is _cough_ _cough_
@ag88301 Жыл бұрын
the fact that it isnt a const by default is triggering
@dr.merlot15322 жыл бұрын
the correct pronunciation is tuples.
@usercommon13 жыл бұрын
Sheeesh
@aditgaur15853 жыл бұрын
First!
@djupstaten2328 Жыл бұрын
Tuples in c++ are breathtakingly stupid. Get() will only let you iterate over them with *const* scalars (yes lambda workarounds exist -- they shouldn't be necessary). They can only be created and manipulated *at compile time* . Who are these people who can't keep their compile time variables neat? Things like tuples, variadic arguments, parameter packs and auto were made for dynamic and unpredictable input at runtime. They have no point unless you completely open up for it. There's a typical 's* or get off the pot' scenario behind this stwongly typed weakness.