Anonymous
But it adds flexibility 🙄 Imagine that you want to change which arguments these functions receive. You would have to change every single function definition…
it does add flexibility at the cost of code that doesn't respect the language's scope and linker boundaries
Anonymous
just find and replace on the text editor can let you replace the arguments you are talking about
Nils
mmmh, sounds somewhat unclean to me :-/
Nils
But I understood the problem. I'll think about it.
Anonymous
it does add flexibility at the cost of code that doesn't respect the language's scope and linker boundaries
> code that doesn't respect the language's scope and linker boundaries sounds more unclean to me
Nils
> code that doesn't respect the language's scope and linker boundaries sounds more unclean to me
It's just inside a header and I don't plan having more than one non-header file
Anonymous
mmmh, sounds somewhat unclean to me :-/
another solution that just came to my mind. if you have similar parameters for a bunch of functions, why not make them into a struct and pass structs (or references or pointers to them) around
Nils
I think I know what you mean but I am unsure
Anonymous
Can you give me a very quick example of what you mean?
instead of function1(vector<int> &a, string b, int c); function2(vector<int> &a, string b, int c); function3(vector<int> &a, string b, int c); struct args { args(vector<int> &a_init, string b_init, int c_init) : a(a_init), b(std::move(b_init)), c(c_init) {} vector<int> &a; string b; int c; } and use args objects for each of the three functions
Nils
ahhhhh
Nils
Yeah, that's a brilliant idea
Nils
thx
Anonymous
np
Nils
lol, my rewrite decreased binary size by multiple tenths of kilobytes!
Dima
nice
Dima
*jealousy node_modules*
Nils
hahaha
Nils
Yeah, nodejs is crappy in size
Anonymous
lol, my rewrite decreased binary size by multiple tenths of kilobytes!
there are more stuff like https://en.cppreference.com/w/cpp/language/variable_template https://en.cppreference.com/w/cpp/language/constexpr https://en.cppreference.com/w/cpp/language/consteval https://en.cppreference.com/w/cpp/language/type_alias that can help reduce usage of preprocessor macros. heck C++20's modules replaces even #include (though i don't know if they added export to existing STL libraries)
Nils
What is a vu64?
Nils
I can't find anything about it
Nils
Also… I have a piece of code that runs on CPU "ARM9" of the device, but I'd like to run some code on CPU "ARM7", how would I do that?
Nils
Btw in this case I afaik am at ring 0 (there is no OS behind it)
Anonymous
guys one q.ask u
Anonymous
ask ask
Anonymous
so tell guys
Anonymous
Can hardware be accessed without an operating system?
Anonymous
how
Anonymous
tell me bro
Anonymous
answer me bro
Anonymous
i need someone to teach me C++
Nils
@W3Technical Stop PMing random people like me thx
Dima
wait what
Dima
hellow
klimi
hellow
i guess hi...
Sameer
Hi
Rsn
where can I find and test my program on c++17 compiler run-time with input data
Rsn
the problem that I have intern’s test and they said that they have c++17 compiler
Rsn
there I can’t pass run-time test
Anonymous
hi i'm struggling with this queue question https://paste.ubuntu.com/p/JPDmw7P2yv/ this is my code. anyone can help me? thanks!
Anonymous
/warn @W3Technical PMing to chat members
Anonymous
answer me
You've already been answered
Anonymous
...
Asdew
He did ask "how," too.
Asdew
how
By going to your computer and opening the case.
Anonymous
Why is that?
just my preference large function body - stateless -> function, stateful -> named functor small function body (less than 10 lines) - stateless -> inline function small function body (less than 5 lines) - stateless -> inline function or lambda, stateful -> lambda
Anonymous
gente to fazendo uma calculado com c# . ta rodando td,,, mas preciso colocar o comando do C/limpar.. mas n ta indo...ta fazendo as operaçoes... mas n ta indo a mensagem que eu queria quando o usuário cliclasse no C.
Anonymous
sorry..i confunding this group ...
Anonymous
i need someone to teach me C++
There is no one who will not waste time on you
Sameer
Hi
Sameer
I'm newbie in c++
Sameer
Kindly help me through this guys
Sameer
I would be thankful to you
Anonymous
dont offtop
Anonymous
what problem do you have
Bhavya
How to make logic building strong in c++??
🐉
Anonymous
wtf
🐉
Why the address is always the same?
Anonymous
this android compiler?
Asdew
I don't use C++, but I believe that's because the variable it is always at the same address, with only the value changed. It only creates the variable once.
Anonymous
Why the address is always the same?
is there any reason why it should be different?
Anonymous
it's initialised once when init-statement is executed
Anonymous
less passive aggressive hint: you are doing &it ^
Anonymous
Why the address is always the same?
Compile with -m64 -fPIC -pie
🐉
less passive aggressive hint: you are doing &it ^
I'm trying to understand what the iterator is actually doing because if it's pointing to a list then an incrementation seems obvious to me that goes to the next position of the list and change address. Seems like it's not what I think
Anonymous
I'm trying to understand what the iterator is actually doing because if it's pointing to a list then an incrementation seems obvious to me that goes to the next position of the list and change address. Seems like it's not what I think
for (int i = 0; i != 5; ++i) { std::cout << &i << ' ' << i << '\n'; } back to being passive aggressive: why do you think the address of i should change?
Anonymous
Why the address is always the same?
Why would this address of the local variable change?