« first day (1562 days earlier)      last day (1282 days later) » 

7:30 AM
What's the difference between the terms "prototype" and "function deceleration"?
 
 
2 hours later…
9:27 AM
Is program that produces integer overflow considered as invalid program if the programmer doesn't care whether the overflow happens or not ?
 
9:45 AM
signed integer overflow is undefined behavior
 
10:04 AM
unlucky
 
 
2 hours later…
Ron
11:43 AM
Which thread out of many gets signaled by the .notify_one()?
 
11:53 AM
one of the ones that called wait :P
 
Ron
Does a condition_variable's .wait() unlock a mutex from the unique lock?
 
yes
until it's done waiting
 
Ron
Does a unique lock unlocks when it goes out of scope?
 
yep
 
Ron
Can a unique lock throw an exception if the mutex is already locked?
 
12:02 PM
It's just calling the lock function of the underlying mutex
so it depends on what the mutex you instantiate it with does
normal mutex would probably just deadlock, recursive mutex would just "work fine" if you locked it in the same thread, etc.
 
Ron
I see. Thanks.
Any way to check if a defered or adopted lock failed from a, for example, unique lock?
 
Ron
12:38 PM
What happens if I try to access the future.get() twice?
 
Ron
12:55 PM
Got it :)
 
 
3 hours later…
4:12 PM
how would you do a minimum spanning tree but with colors
 
4:23 PM
ignore that now
 
 
2 hours later…
6:40 PM
If I had a vector v1 and I move-assigned it to another vector v2 (so v2 got the resources from v1), can I use v1 now for something else ? For example, can I do v1=v3 where v3 is another vector ?
By "can I" I mean, will I be able to use that v1 vector normally if I reset his elements ?
 
sure
 
cool
thanks
 
it's unspecified what is the contents of the moved from vector, but in any sane implementation it will be empty
on the other hand if you do v1 = v3; then you'll be sure what the contents of v1 are
or v1.clear();
 
I see, that makes perfect sense
 
 
1 hour later…
8:02 PM
I want to pass a function as a template parameter in a function, but in that function I want to call a function with 3 arguments (if it has 3 parameters) or with 4 arguments (if it has 3 parameters) .
And compiler doesn't allow me that
 
@kenkar tag dispatch?
 
I don't know what that is
so in short, I wanna do this
template <typename func1>
void show_examples(func1 f) {
if (par_num == 2)
sum = f(x,y);
else
sum = f(x,y,z)
 
8:39 PM
@kenkar

template <typename RETURN, typename... ARGS>
void show_examples(RETURN(*f)(ARGS...)) {
    if constexpr(sizeof...(ARGS) ==2){
        f(x,y);
    }else{
        f(x,y,z);
    }
}
 
Did not know you could do stuff like that. Thanks
Would there be a solution if function show_examples takes 2 functions ?
lemme rephrase
if I want to do the same thing but with:
template <typename func1, typename func2>
 
9:00 PM
template <typename F1, typename F2>
void show_examples2(F1 f1, F2 f2)
{
  show_examples(f1);
  show_examples(f2);
}
 
Clever. Yeah , thanks
 
//or if you want

template <typename RETURN, typename... ARGS>
constexpr int get_num_args(RETURN(*f)(ARGS...)) {
    return sizeof...(ARGS);
}

template <typename F1, typename F2>
void show_examples2(F1 f1, F2 f2)
{
   int args1 = get_num_args(f1);
   int args2 = get_num_args(f2);
}
 
9:21 PM
Hi
 
nope, but it looks neat.
 
how can I use it with tor?
 
presumably with its proxy support
 
The proxy is as follows: cli.set_proxy("host", port);
which means if I run tor locally, I'd use cli.set_proxy("localhost", 9050);
but how does it resolve .onion urls?
 
by just sending the hostname through the proxy normally. No idea what this specific library does, but I don't see how it's different from how it would work on any other proxy
 
9:32 PM
it sends and receives HTTP(S) responses
no DNS specific settings?
 
yeah, and if you're using a proxy you normally just send the full hostname in the HTTP request instead of resolving it, right?
 
9:53 PM
ok
 

« first day (1562 days earlier)      last day (1282 days later) »