Ross Finlayson writes:
On 04/22/2024 07:32 PM, Sam wrote:
Ross Finlayson writes:
Hello I hope I might consult your expertise, I'm wondering about
a use-case where for a given library object, to provide an instance
of same type, that on any access, throws an exception.
What does "any access" mean? Please be specific.
As if it were null, whatever would raise a segfault,
is the idea of "any access", then I wish I better
Again, you need to explain what "whatever" means.
Are you looking for a class with deleted copy/move constructors or
assignment operators?
Are you looking for a class with an overloaded * or -> operator that throws
an exception?
/What/ are you looking for?
explain the differences among pointers, references, and
class returns from functions, looking at C++ 11,
and trying to understand some of the newer syntactic
sugar with regards to declarations.
Perhaps it would be more productive to invest a little bit more time
studying C++11, and learning the different parts of C++, what they are, and
how they work, before attempting to ask a meaningful question.
The term "any access" is utterly meaningless and context-free, in C++ terms. Nobody really understands what exactly you're asking.
std::vector<int> values() {
return static_cast<std::vector<int>> nullptr; // no
}
No self-respecting C++ compiler will compile this. This is syntactically invalid.
The idea is that some code can compute partial results,
or to the effect of launching asynchronous requests
void rr1(const std::string& s) {
std::list<std::string> l1 = rr2(s);
int i1 = rr3(s);
int i2 = rr4(s);
int siz = l1.size(); // throw
int i3 = rr5(i1, i2, l1.size());
}
What is "rr2"? What is "rr3"? What is "rr4"? What is "rr5"?
so the idea is the re-routine runs through statements
as long as the inputs are satisfied, then these
What "inputs"? What does "satisfied" mean?
rr1, 2, 3, 4, 5 throw if their arguments are the
null_throwing type, and any library code access
What does "null_throwing" mean?
C++ is very complicated. When discussing C++ it is very important to be explicit and use consistent terms that are well-defined in C++.
[deletia]
It's an idea for writing co-routines in the language
You will do yourself a huge, huge favor, by forgetting everything about co- routines.
co-routines are a solution in search of a problem.
The only reason co-routines exist in C++ is because real execution threads absolutely suck raw eggs in Microsoft Windows, and Microsoft hijacked the standardization process to infect C++ with this co-routines bullshit just so that MS-Windows would finally have a multi-threading implementation model
that does not suck.
This way then the re-routine sort of automatically
primes its asynchronous results in whatever results
getting to the invoked re-routines, "satisfied" or
"satisfying" inputs, so that they're initiated
with completion handlers to populate the monad
and push the next re-run or the re-routine to
the task queue, which flows in the otherwise
flow-of-control in the language exactly the same
each time until it itself actually completes
and calls back to the originating (initiating)
callback (completion handler).
Go ask Microsoft. They invented all this bullshit. They can deal with it,
by themselves.
(It's been a while, I need to learn C++ 11
co-routines are not C++11.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)