Anonymous
Who wants to create a plugins for Unreal with me for fun/market
Anonymous
C++
klimi
Who wants to create a plugins for Unreal with me for fun/market
what do you mean? Are you advertising a job?
Anonymous
what do you mean? Are you advertising a job?
No just a fun project with other people we can just put it on git or whatever or free on unreal
.
Has anyone worked with coroutines?
.
I wonder how to make it so that "co_await" wait for the arrival of data without parallelism and at the same time perform the main task
Anonymous
Jii
Anonymous
I wonder how to make it so that "co_await" wait for the arrival of data without parallelism and at the same time perform the main task
You can't do that. The function which calls co_await is suspended and hence it can't do anything else. In the calling function (the function which called the coroutine) where co_await returns, you can proceed with doing something else as long as you are not awaiting the result of the function which was suspended earlier Your example however is an use case for parallelism (using threads or tasks with promise and futures would be a better option).
Anonymous
Coroutines function are stored in the heap right?
Yeah till C++ standard supports stackful coroutines
Siddhanth
Im not sure if coroutines are there
Siddhanth
In heap
Anonymous
I don't think so
The information needed to resume a coroutine is indeed stored in the heap (or free store). All the existing coroutine implementations (gcc, Clang, MS C++ ) in C++ are stackless. You have external libraries like CO2 which support stackful coroutines.
Siddhanth
I'll go check it out now
MᏫᎻᎯᎷᎷᎬᎠ
Yeah till C++ standard supports stackful coroutines
But the programmer doesn't need to worry about memory leak, right? And how to distinguish between the function returning with co_yield or co_return? To avoid recalling it again
...
How do I access classes with C++ GetProcAddress? When I try to reach it, it returns a NULL value, the code I used to reach GetProcAddress(dllModule,"classname::Function")
Anonymous
But the programmer doesn't need to worry about memory leak, right? And how to distinguish between the function returning with co_yield or co_return? To avoid recalling it again
No. The memory is managed by the implementation. As to how to distinguish between a function that uses co_yield and a function that just completed its task and uses co_return, you can distinguish based on the return values. A function that uses co_yield expects to be resumed and hence the return value would be some kind of a generator. You could use co_yiepd and co_return from the same function (co_yield for returning intermediate values while processing is going on and co_return when the function is completed). Typically the generator returned from this function will be able to distinguish between whether a value was yielded or if the function completed execution
MᏫᎻᎯᎷᎷᎬᎠ
The standardisation process is slow, there is a talk in cpp podcast about whether the language is Dying or not
MᏫᎻᎯᎷᎷᎬᎠ
Bryce complained about that and mentioned that the some committee members should give up their power in order to make the standardisation process much faster thus improving the language
MᏫᎻᎯᎷᎷᎬᎠ
I don't know about that but I have moved on to C# and Rust
Rust is good, it just feels like a lack of flexibility and freedom But anyway, in work environment that restriction is a saviour
MᏫᎻᎯᎷᎷᎬᎠ
I wonder if its maturity measured, what will we give it out of 10
MᏫᎻᎯᎷᎷᎬᎠ
I like its macro system Sometimes I feel that trait bounding is too much restrictive
MᏫᎻᎯᎷᎷᎬᎠ
A trade off for good error message
Anonymous
I like its macro system Sometimes I feel that trait bounding is too much restrictive
If I reply to it, it will become offtopic. So let us stop discussing Rust.
MᏫᎻᎯᎷᎷᎬᎠ
You are right I forgot myself
MᏫᎻᎯᎷᎷᎬᎠ
Anyway I feel this code should compile, but seems this feature is likely will be added later in the standard: consteval int foo(std::size_t size){ std::array<int, size> ar; return 0; }
Anonymous
Anyway I feel this code should compile, but seems this feature is likely will be added later in the standard: consteval int foo(std::size_t size){ std::array<int, size> ar; return 0; }
It is being debated And there are reasons why this doesn't work. There is a difference between evaluation at compile time and instantiation at compile time. The arguments to a consteval function IMHO should not be treated as template arguments.
MᏫᎻᎯᎷᎷᎬᎠ
It is being debated And there are reasons why this doesn't work. There is a difference between evaluation at compile time and instantiation at compile time. The arguments to a consteval function IMHO should not be treated as template arguments.
I disagree If auto in parameters are treated as template parameters type, then it is more appropriate to do so for consteval parameters Anyway What does compile time instantiation mean in this context, I thought It's something related to templates
MᏫᎻᎯᎷᎷᎬᎠ
Compile time function doesn't exist in anyway, they are just resulted compile time computed values
Anonymous
Compile time function doesn't exist in anyway, they are just resulted compile time computed values
I know what consteval is consteval int func(int& x){return -1;} int x{}; static_assert(func(x)==-1); Arguments to consteval functions need not be constant expression. Read this link to understand the arguments against consteval functions being used as template parameter arguments - https://stackoverflow.com/questions/56130792/will-consteval-functions-allow-template-parameters-dependent-on-function-argumen Read all the answers in that link Also think of a case like this which is not currently supported consteval auto func(int n){ if constexpr(n==0) return 1; else { using T = decltype(fn(n-1))*; return T{}; } } This doesn't work because consteval functions don't support instantiations at compile time which was always the idea behind them. They were meant to be evaluated at compile time rather than supporting instantiations of the sort you see with template functions. Supporting instantiations in consteval functions would defeat the type system consteval functions by their definition in the standard are parsed once and evaluated each time at the call site during compile time. This is very different from how template instantiations work. So like I said there is a difference between compile time evaluation and compile time instantiation (TMP included).
Anonymous
If you have further questions just ask away. I am winding up now but will reply when I get the time
...
Did you know that network has been added to C++?
...
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2171r1.pdf
MᏫᎻᎯᎷᎷᎬᎠ
Did you know that network has been added to C++?
I think it's still a proposal for 26 standard
MᏫᎻᎯᎷᎷᎬᎠ
I guess it will be asio
Anonymous
Which probably won't be supported since it goes against One definition rule
Why? Consteval functions are not functions as you said. Why should this violate ODR? They just translate to compile time values. You seem to be contradicting yourself. And this was exactly my point on why consteval functions can't be treated as equivalent to template functions
MᏫᎻᎯᎷᎷᎬᎠ
Why? Consteval functions are not functions as you said. Why should this violate ODR? They just translate to compile time values. You seem to be contradicting yourself. And this was exactly my point on why consteval functions can't be treated as equivalent to template functions
I'm still trying to process that, the possible edge cases I think my argument still valid; they are still compile time computed values, even if it requires instantiation of other templates entities This can just be treated or implemented equivalent to explicitly instantiate those entities everytime there is a call Since they are just computed values, then there should not be any definition at all to violate
Anonymous
I'm still trying to process that, the possible edge cases I think my argument still valid; they are still compile time computed values, even if it requires instantiation of other templates entities This can just be treated or implemented equivalent to explicitly instantiate those entities everytime there is a call Since they are just computed values, then there should not be any definition at all to violate
That is not how the standardization process works. You can say everything can be supported by taking an equivalent case that is supported. But that wasn't the idea of the people who proposed consteval and constinit in C++20. Andrew Sutton who proposed consteval himself is against the proposal of allowing consteval function arguments being used as template parameter arguments. He presented a lot of cases which are not corner cases but mainstream. Read the proposal paper and the discussion that followed. It seems unlikely that this will be accepted unless someone comes up with a drastic reversal which proposes how they can coexist
Sky's
Hi is there someone who's willing to help me in creating a code for my sumobot?
me_
What is the best? Bring data from Data base to list and then deal with it Or it is better to deal with the data and it is surrounded there, but we call it at the time of the need
😂
klimi
Rose
User Akash has 1/2 warnings; be careful! Reason: PMing
...
When I use the glm::toMat4(glm::quat(vec)) code in C++ OpenGL, the angle turns out to be incorrect, when I do 4.0 degrees, it becomes 45.0 degrees, what is the reason for this?
Rose
User Mitesh has 1/2 warnings; be careful! Reason: ask admins before self promoting like a shameless click slut
Brokssy
Hey
Brokssy
How can i install lib graphics.h on visual studio on c++ ?
莉莉亚娜🇨🇳
Hello, someone have a simple github repo for a methods post and get in C?
Rose
Reported to admins.​​​​​​​​​​​​
Otoniel
Hello, someone have a simple github repo for a methods post and get in C?
cURL is pretty common, other option is SOUP, from gnu family, for both you can ask chatgpt for explained examples, i guess you'll get it right
莉莉亚娜🇨🇳
Without curl or soup
MᏫᎻᎯᎷᎷᎬᎠ
How can i install lib graphics.h on visual studio on c++ ?
If it's a header only library you can grab the file directly to your project and start using it
Manav
If it's a header only library you can grab the file directly to your project and start using it
They're probably referring to headers provided by borland's ancient (now dead) compiler.
Manav
How can i install lib graphics.h on visual studio on c++ ?
Whoever is teaching you C++ is a moron who thinks it's still 1900s, it's in your interests to leave them and look for better teachers/places to learn C++.
Manav
It's nearly 2024 and we still have people trying to use turboc++ 🫠
imminent
Indians seem to learn C++ that way for some reason lol
imminent
My guess it's that schools there just still follow the old materials and such
Manav
My guess it's that schools there just still follow the old materials and such
Nah, it's officially removed even from school syllabus across all education boards in India.
Manav
They're taught python instead in schools. Can't say for old teachers/profs that still insisting on that shit
Manav
How can i install lib graphics.h on visual studio on c++ ?
Also they owe you an explanation as to why they're teaching ancient shit. And you deserve a refund if you paid for classes, etc.
Otoniel
Without curl or soup
You mean sending requests with pure c code, no lib!? It'll be specially hard. Any here's a helpful resource: https://beej.us/guide/bgnet/html/index-wide.html
...
How can i install lib graphics.h on visual studio on c++ ?
It will be better to use modern Graphics APIs. You can start with OpenGL
...
learnopengl.com you can learn from this source
Adeyemo
Hello Everyone, I have a bug that have been disturbing for about two days now. I don't know to solve it. Please I need help.
Adeyemo
socketServer.c: In function ‘void receiveAndPrintIncomingDataOnSeparateThread(AcceptedSocket*)’: socketServer.c:38:28: error: invalid conversion from ‘void (*)(int)’ to ‘void* (*)(void*)’ [-fpermissive] 38 | pthread_create(&id, NULL,receiveAndPrintIncomingRequest,clientSocket->acceptedSocketFD); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | void (*)(int) In file included from socketServer.c:3: /usr/include/pthread.h:204:36: note: initializing argument 3 of ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*)’ 204 | void *(*__start_routine) (void *), | ~~~~~~^~~~~~~~~~~~~~~~~~~~~ socketServer.c:38:73: error: invalid conversion from ‘int’ to ‘void*’ [-fpermissive] 38 | eate(&id, NULL,receiveAndPrintIncomingRequest,clientSocket->acceptedSocketFD); | ~~~~~~~~~~^~~~~~~~~~~~~~ | | | int
Adeyemo
That's my error
Adeyemo
What is pastebin?
Victor
What is pastebin?
are you banned in google search?