ajay
Which language should I learn first I'm beginner & I'm a B.SC student
Anonymous
Then what
You've been told already: #ides
Anonymous
Ok
Anonymous
Because whenever i run my code it exit with an error
klimi
codeblocks are fine by me tho
Anonymous
Good for you
What do you mean by good for me?
Ilya
Thnks can u suggest any book
For Python? Ask in Python group!
ajay
👍👍
MᏫᎻᎯᎷᎷᎬᎠ
Are we going to have a modular std library in C++20?!
Anonymous
Hey, I want to static_assert a template parameter of a member function declaration (there's no function body to put it in) and there's no point to it if I put it in the definition (.cpp) Is there a way to do this?
Anonymous
class SomeClass { public: template <a_type something> Func(); } Let's say I want to static_assert(something.., ...)
Anonymous
So Func's body has to be with class definition
Anonymous
So you put static_assert in the function body
Anonymous
Actually, what are you trying to achive?
Anonymous
Templates must be defined in header files in most cases
Nope, the parameters are bool, there's cpp with: template class SomeClass<false, ...> template class SomeClass<true, ...>
Anonymous
It's a class with variations
Anonymous
And how does SFINAE relate to it... I think your example doesn't show what is actually in your code Neet more info
fadgadred
Hae programmers i have a question
Anonymous
This is to ensure the user is not violating the SFINAE
What do you mean by "violate SFINAE"?
Anonymous
Ok wait
Anonymous
What do you mean by "violate SFINAE"?
By changing the default t-parameter
Anonymous
I don't understand you.. Waiting for more expressive example
Anonymous
header: template <bool A> class Example { template <bool E = A, typename std::enable_if<E>::type* = nullptr> void Func(); // I want to make sure A == E // If the user changes the default // Else, they will face some weird object errors } cpp: template <bool A> template <bool E = A, std::enable_if<E>::type*> void Example::Func() { ... } template class Example<false>; template class Example<true>; template void Example<true>::Func(); // So they're compiled and usable Where to put the static_assert?
Alka
😇😊
Anonymous
Btw that's off topic..
Anonymous
I can be wrong But I've been told that there are rare use cases when you can define them in cpp files
Anonymous
I can be wrong But I've been told that there are rare use cases when you can define them in cpp files
This is one of them, it's like multiple classes with a same identifier
Anonymous
Because of finite template parameter combinations
Anonymous
Seems legit
Anonymous
Then I think if constexpr is your solution
Anonymous
Guess* there's no way to static_assert there? :/ Found nothing by searching
Anonymous
Anonymous
🤔 I'll check it out
It's like readable SFINAE😂
Anonymous
But since C++17..
Anonymous
But since C++17..
That's fine as I'm using its shared_mutex
Anonymous
That's fine as I'm using its shared_mutex
Please more questions from you in this group😂
Anonymous
Why 😁
They are interesting
Anonymous
😬 probably will ask while doing this via if constexpr
Dima
well perhaps you are right. I started from C wayy back then but later moved to C# and then later again to c/c++
Francisco
And modules useless....
I don't think so
Francisco
In fact, I think they're going to improve all the C++ environment
MᏫᎻᎯᎷᎷᎬᎠ
Anonymous
Ok
And vs-code for linux 🤔 there is a pretty good C++ extension by msft but you should specify compile commands in some config files..
Anonymous
How
Are you on Linux?
Anonymous
Anonymous
Ok so, Visual Studio
fadgadred
Okey thanks for this steps rose
Fadel
Ok
Asad
hello! my program gets input from user. input type is integer. when user enters char type, the program breaks down. how can i handle it?
Asad
i want to do something like when character type is entered the application warns the user
mbuf
i want to do something like when character type is entered the application warns the user
https://stackoverflow.com/questions/8611815/determine-if-char-is-a-num-or-letter
Anonymous
what sort of bad practices do you C developers bring to c++ when they learn c first ?
Anonymous
I love it
Anonymous
Oh that's another good question
i hear people say it lot , so i wonder if there are things to keep in mind when learning C first if you plan on transitioning into c++
Anonymous
The first thing is using C standard library when C++ has good alternative
Anonymous
hey