Sam
Jesvi
Mohit
Hi friends how to create our own header file?
Anonymous
Isn't first one requires is requires-clause and the second one is requires-expression?
Asdew
#ot
Anonymous
/get cppbookguide
Mar!o
Anonymous
hey im taking a class in mutithreaded programming and i have an exercise where i dont have any clue to what i should calculate there.
Anonymous
Anonymous
if somebody could tell me what is meant by average delay there that would be great :)
Anonymous
What i did for now is just to program both cases out and perform benchmarks for various things lilk the total computing time, the time it takes to switch threads etc. but when i had a second look this doenst seem to be what was asked for
Francisco
For example, I'd do:
template <typename T>
concept dereferenceable = requires (T t)
{
t.dereference();
};
Francisco
Yeah, that's what I'm saying
Francisco
For me it's more readable defining a concept than using an inline requires-expression
Anonymous
Ohhhh thanks. Got that completely wrong
Anonymous
Yeah that isnt possible unfortunately :/. But thats the way i saw it at first but that would be the administration time right? And in the exercise there is stated that we should ignore that. But since i already calculated that i can inclufe that as well as a footnote. Again thank you so much for your 1st interpretation. I think that is what he meant :)
Dima
/ban @KMRSOFT_9 python + ad + not approved + read the rules
Dima
I warned you already, but python people can’t read it seems
Emir
Is this work on mac os, but it isn’t work on windows, why is that?
https://paste.ubuntu.com/p/ZrHSCkCGTb/
studentx txt file is 8 line, in windows loop just one cycle
Dima
maybe because of file format?
Emir
Dima
I mean next lines etc
Emir
Emir
File is this
Emir
windows just created VIANNEY.txt and it’s empty. Mac os 8 files created
Emir
Emir
ʎpoqǝɯos ǝʞɐℲ
Say hi if I r not dumb
Anonymous
Код:
template <typename T> void foo (T arg)
requires { arg.method(); }
{}
Компилятор (GCC 10.1 с -std=c++20):
source>:2:10: error: missing additional 'requires' to start a requires-expression
2 | requires { arg.method(); }
| ^
| requires
Так что тот товарищ неправ
Anonymous
↑
Francisco
Which parenthesis?
Anonymous
int main(int argc, char **argv) {
return argc;
}
Anonymous
Done what was so difficult?
Anonymous
If you want to avoid a compiler warning
Anonymous
int main(int argc, char **argv) {
(void)argv;
return argc;
}
Anonymous
template <typename T> void foo (T arg)
requires arg.method();
{}
vvv
<source>:2:13: error: use of parameter outside function body before '.' token
2 | requires arg.method();
| ^
<source>:2:13: error: expected initializer before '.' token
<source>:3:1: error: expected unqualified-id before '{' token
3 | {}
| ^
Francisco
I think this is the way when defining a concept, as there's no variable name yet, in contrast with a function, where you already have the argument name
Anonymous
template <typename T> void foo (T arg)
requires (T arg) { arg.method(); }
{}
vvv
<source>:2:13: error: expected primary-expression before 'arg'
2 | requires (T arg) { arg.method(); }
| ^~~
<source>:2:12: error: expected ')' before 'arg'
2 | requires (T arg) { arg.method(); }
| ~ ^~~~
| )
Nameful
Do you guys know any high-level crypto libraries usable with C++ that have decent documentation?
Nameful
GPGME's is lacking in examples
Anonymous
Is there any short way to prepend to a string without using a second variable?
Антон
Francisco
Francisco
Then you have to use strcat
Francisco
The problem is if b is not a variable but a pure c-string
Francisco
For example, doing strcat(str, str2); or strcat(str2, str); is okay, but strcat(str, "Some string"); is okay while strcat("Some string", str); is a compile error
Anonymous
Anonymous
Anonymous
You can't exactly edit it
Anonymous
Nothing different from what @fgallego96 said.
char st[100] = "world";
char st1[10]= "hello ";
Trying to prepend so that st stores "hello world". Cannot append to st1 because it's too small.
Francisco
Anonymous
Francisco
I guess in the memmove you wanted to write strlen(st1), am I right?
Francisco
Okay
Anonymous
Okay thanks
Anonymous
/get ide
NXiss7
Hey everyone.
Is there a reasonable way to store sensitive data in memory?
Anonymous
/get eBook
Anonymous
/get cbook
Francisco
NXiss7
Encryption
On memory?
I'll store user password.
Francisco
On memory?
I'll store user password.
Yes. If the data in sensitive, and you don't want people to read it easily, your best option is to encrypt the data, so a potential attacker can't get the original message without masive computational power
NXiss7
Yeah, thanks.
Does OpenSSL AES objects store keys encrypted?
Francisco
I have no idea because I haven't used it, but OpenSSL is pretty common in security stuff, so you may find what you want in the official documentation
MᏫᎻᎯᎷᎷᎬᎠ
How does if constexpr really works internally?!
Is there any generation of function when the second constant boolean expression takes a new branch?
Anonymous
Anonymous
When it's not used it can ill-formed code of some kind (not too much ill-formed)
MᏫᎻᎯᎷᎷᎬᎠ
Is that even possible
It's like saying:"I'm bad but Good"
Anonymous
Anonymous
Because if constexpr is just а good-looking sfinae
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Past you need to overload the function in a recursive manner