Ehsan
and you have complex return types
Ehsan
ofcourse you will use auto, you will not define everything 🙂
Diego
You'd be better off using typedef I'd say, but I see what you mean
Pavel
you don’t need to once you use auto
Or you don't need auto once you use typedefs (or better using). I mean, explicit types..
Diego
It's more verbose, easier to work with
NM
Who know's small mail client on C (send mail only). If was source - thanks
NM
sendmail
mail client 😉 not smtp service 😉
klimi
So complete mua?
NM
yes
NM
source need's on C
klimi
Complete mua for sending email only?
klimi
But you dont want SMTP sender
NM
Yes, and add other code on C
klimi
So you dont want sendmail
NM
Yes, i can emulate "telnet hello or other on systemD (cmd) call ?
klimi
Because sendmail is SMTP enail client but you don't want that cuz you say it is SMTP service?
NM
I know, yes
klimi
I am quite confused, what do you want then?
NM
I want samples as in GO code but on C package go_mail_client type MailClient interface { // Sends email Send(email, subject, body string) error }
NM
With not use system(cmd) for call MTA
NM
what?
I find https://github.com/somnisoft/smtp-client
klimi
So you dont want mail client in C but you want mail library for C
NM
Yes, you right
Ehsan
Yes, you right
Why though?!
Ehsan
This is weird. C is not the best option for these kind of things.
Ehsan
Use python
Igor🇺🇦
With not use system(cmd) for call MTA
Here are some examples of sending emails in different languages: https://www.rosettacode.org/wiki/Send_email
Hanz
@admin
Dada
guys anyone know online judges for cracking the coding interview
MᏫᎻᎯᎷᎷᎬᎠ
Do Gcc or clang support string literal as template parameter yet?
Vlad
Do Gcc or clang support string literal as template parameter yet?
You can check new C++ features support on cppreference
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
You can check new C++ features support on cppreference
But I thought it was just a simple template<const char* lit> myClass and then just call myClass<"Hello, world">
Vlad
It requires constexpr std::string
MᏫᎻᎯᎷᎷᎬᎠ
But I thought it was just a simple template<const char* lit> myClass and then just call myClass<"Hello, world">
Because my GCC 10.2 complains about it with error: non-type template argument does not refer to any declaration error: ‘"Hello, world"’ is not a valid template argument for type ‘const char*’ because string literals can never be used in this context 54 | int main() { test<"Hello, world"> te; } | ^
MᏫᎻᎯᎷᎷᎬᎠ
I doubt it
The cppreference refers to this proposal http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf
MᏫᎻᎯᎷᎷᎬᎠ
It requires constexpr std::string
And it's not supported yet constexpr std::string is not a string literal🤔
MᏫᎻᎯᎷᎷᎬᎠ
Vlad
Yes?
So it's not in the standard
Vlad
It's just that. A proposal
MᏫᎻᎯᎷᎷᎬᎠ
So it's not in the standard
Check the proposal date it was from the 2018 and it is accepted If it wasn't it wouldn't be on the C++20 compiler support list
MᏫᎻᎯᎷᎷᎬᎠ
https://en.cppreference.com/w/cpp/compiler_support/20 check for Class types in non-type template parameters in C++20 feature section
Igor🇺🇦
Do Gcc or clang support string literal as template parameter yet?
It supports this library https://github.com/hanickadot/compile-time-regular-expressions So it should work.
MᏫᎻᎯᎷᎷᎬᎠ
It supports this library https://github.com/hanickadot/compile-time-regular-expressions So it should work.
yeah that's I why I wondered it But It doesn't seem simple to use it just like template<const char*>
Anonymous
But I thought it was just a simple template<const char* lit> myClass and then just call myClass<"Hello, world">
integers, floating point types, and class types with constexpr constructors are supported
Anonymous
yeah that's I why I wondered it But It doesn't seem simple to use it just like template<const char*>
this should work struct char_ptr { const char *m_data = nullptr; constexpr char_ptr(const char *data) : m_data(data) {} };
Anonymous
Ehsan
But you can go around it
Ehsan
Just make a struct containing a String
Ehsan
I mean it’s not that big of a probelm 😅
ʟᴏɴᴇᴡᴏʟꜰ
I'm having a doubt in java can some help me...?😅
Roxifλsz 🇱🇹
Yeah what an interesting way to write 'Java'
ʟᴏɴᴇᴡᴏʟꜰ
Yeah what an interesting way to write 'Java'
I asked the doubt in the java groups mentioned in @en_it_chats but no one is replying..
ʟᴏɴᴇᴡᴏʟꜰ
We all do
Thanks brother...🙏 I got the answer
MᏫᎻᎯᎷᎷᎬᎠ
this should work struct char_ptr { const char *m_data = nullptr; constexpr char_ptr(const char *data) : m_data(data) {} };
Yes I did something similar to this like: template <std::size_t N> struct StringLiteral { constexpr StringLiteral(const char (&str)[N]) { std::copy(str, N, value); } char value[N]; }; template <StringLiteral lit> struct test {}; auto main() -> int { test<"Hello, world"> t; return 0; } But didn't work same goes for your example
Codigo
I have a question. Before, C++ was considered "C with Classes". Is it still the case? I mean, is there something you can do with C++ that you can't do with C? I C++ still a C version?
Igor🇺🇦
I have a question. Before, C++ was considered "C with Classes". Is it still the case? I mean, is there something you can do with C++ that you can't do with C? I C++ still a C version?
It was called C with classes only at the very beginning. It's not C with classes for very long time. C++ is evolving much quicker and is significantly larger than C.
Ehsan
so the question you should ask is: “is there any benefits in using c++ over c?” the answer is yes, there are many benefits, examples: Lambads Auto keyword Templates Exception handling Function overloading Object oriented programming
Ehsan
And most of the things you can do in c, you can do in c++
Ehsan
BUT this is a sword with two edges. If you want to make low level programs(i.e. operating systems, version control, etc…) YOU SHOULD USE C. It’s because you won’t use most of the features of c++, it will just be an pain in the ass for no reason. Other than that use c++.
Ehsan
also most low level programs ar written in C
Nils
How to calculate 1039 * 3749 * 8473 in C++?
Nils
Seriously?!
uint64_t(1039 * 3749 * 8473) warning: overflow in expression; result is -1355615565 with type 'int'
Ehsan
you will need to account for that