Richard Luo 🐱
any extension for vscode to convert . to -> ?
Anunay
It's fine and replace all
Richard Luo 🐱
It's fine and replace all
thanks but what I want is when I type . vscode will automatically transform . to -> if it is a pointer
Anunay
It's absurd
Anunay
#include <header.hpp> Will change to #include <header->hpp>
Anunay
Anunay
But you don't necessarily need to replace all, but that won't be a one step process
Anonymous
Bhaskar
Bhaskar
Can anyone explain me this?
Artöm
You have T a, b; a < b will call bool T::operator<(T arg) (assumed it exists), a is *this and b is arg
Artöm
So binary operator overloader as member function has 1 implicit and 1 explicit parameter
Đỗ
It's not
why not? Do a simple benchmark by yoursheft (I suppose that you know how to create a simple test with inline/pure function and benchmarking it, hhm???)
Đỗ
What the fuck you're talking about
Read your txtbook or any material you have again, especially about memory allocation/management in C++
Anonymous
Inline has nothing in common with memory allocation lol
Anonymous
Compilers know better what to inline and what not to
Anonymous
https://en.cppreference.com/w/cpp/language/inline
Mar!o
Compilers know better what to inline and what not to
For a stricter suggestion we have inline and forceinline for MSVC for example
Anonymous
For a stricter suggestion we have inline and forceinline for MSVC for example
It's not a C++ It's a C++ dialect from Microsoft
Mar!o
It's not a C++ It's a C++ dialect from Microsoft
Yes it's a non standart compiler extension...
Рома
Guys, can you explain to me func()(add a new element into the already sorted list)? I don`t understand how we add the previous pointer to the new one.
Рома
https://pastebin.com/raw/fxM9WNp6
Рома
I tried to draw it for myself.
Anonymous
Hello everyone...I am new here and I am the beginner...for c++. Cam someone help me out in starting with it
Anonymous
I didn't understand...what do this hashtag means
Anonymous
U had deleted it
Anonymous
Kindly help me out in how to get started with it
Anonymous
Anonymous
oh but the content in chapter 6 is required by chapter 7 :(
Anonymous
can i skip both? 6 and 7
Anonymous
would doing that make other chapters hard for me :(
Anonymous
Can anyone please share a book for beginners on c++ ?
Dima
if you can’t read the rules, how can you read the book, bruh.
Anonymous
Lmao x2
Anonymous
thanks for the reply , ive been stuck up with that chapter for like a month now , have a nice day :D !
Som
1) Define a class interest in c++ with the following description: Private members : Principle of float type Rate of float type Time of float type Interest of float type Amount of float type Public members : A function enter () to allow user to enter the value for principle,rate of interest and time period. A function show () to allow user to view the content of all members
Som
Help me out guys!
Dima
try to write it yourself first
Dima
it’s easy
Som
I know just a bit confused. Sure i will try it out!
Ikmal
hi
Ikmal
does anyone online?
Sourabh
Yup 897 are.
Anonymous
is there a compiler group?
Alex
Hello. I have field std::map<std::string, *std::map<unsigned int, float>> widths; I have to allocate memory or to point widths[key]::value to existing map depending on criteria in runtime. I am going to add flags to store info about deleting widths::value in destructor. Do you know better pattern to resolve this task?
Anonymous
Hello. I have field std::map<std::string, *std::map<unsigned int, float>> widths; I have to allocate memory or to point widths[key]::value to existing map depending on criteria in runtime. I am going to add flags to store info about deleting widths::value in destructor. Do you know better pattern to resolve this task?
did you mean std::map<std::string, std::map<unsigned int, float>> widths; because the asterisk on front doesn't make sense. if you meant that, then you don't need to do anything. applying the [] operator on std::map automatically constructs a mapped_type object if it doesn't exist for the given key.
Anonymous
need code review https://github.com/chandradeepdey/C-_Primer_5th/blob/master/16/16.16/vector.h
Anonymous
i would like to automate tests, but i have no clue how to start. anyone have tutorials? (written preferred over video)
Dima
I think or it lacks some comments
Anonymous
I think or it lacks some comments
not really. line 515-618 are the implementation related functions. rest just use them and the public interface at every opportunity.
Anonymous
and the public interface itself is documented in the standard/cppreference
Dero
so true
︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎ ︎
RishiGss
how do I get started with make and gdb?!
Chernykh
And there's no necessary to learn make because in 21 century it's basically useless for understanding low level build tool. It's better to learn cmake
Som
I have learned how to write basic c++ programs with using namespace std but my teacher is teaching it in conio.h I am getting all messed up between both the concepts Does anyone have any advice?
Pavel
Anonymous
Alex
I have learned how to write basic c++ programs with using namespace std but my teacher is teaching it in conio.h I am getting all messed up between both the concepts Does anyone have any advice?
conio.h is not part of standard library. it is not used in production code nowadays. however, I don`t feel its about c++ concepts or basics, its just library. software engineer use lots of them in career. can`t really understand your issue
Som
Actually my teacher gave me questions to do and he explained them using conio.h and i have learned how to make programs using name space std and now i am having difficulties in doing the programs. Like in short understanding in conio.h and doing using namespace is brain drain !
Alex
you don`t need conio.h to go to a job. but as SE you should be able to use any library
@𝑺𝒐𝒃𝒌𝒂
/warn
Mr.James
conio.h is not part of standard library. it is not used in production code nowadays. however, I don`t feel its about c++ concepts or basics, its just library. software engineer use lots of them in career. can`t really understand your issue
Exactly if you will think about that, according to language there is no C++ it's purely c with class... Definitely conio.h is widely use in c not in C++ , if anyone will try to use it just as a library function only.... Guys of uh have any better solution uh may share