« first day (657 days earlier)      last day (2187 days later) » 

12:11 AM
Yes
Since it worked fine for certain pairs before and for some it doesn't
Which is really odd honestly
 
1
A: How to add timer to every method of class?

seheReversing the initiatives a bit you can also use: template <typename Caption, typename F> auto timed(Caption const& task, F&& f) { return [f=std::forward<F>(f), task](auto&&... args) { using namespace std::chrono; struct measure { high_resolution_clock::time_poin...

@Annabelle It's never odd. Also, I didn't mean "have you tried running it". I meant: have you tried debugging the execution of the run that doesn't have the expected outcome?
 
I'll try stepping through a debugger with it and see if I notice anything then.
 
 
15 hours later…
3:30 PM
hello! id like to share something i found out with a friend while messing around with variables, apparently i can make achar pointer point to a int to get the numbers that are in the first byte
this is the code (working)
#include <stdio.h>
#include <stdlib.h>

int main()
{

    int a = 65;
    int i;
    int * p = &a;

    printf("%d\n", *p);
    printf("%p\n", p);

    unsigned char *c = p;

    printf("\n\n (int)%d  (char)%c\n", *c, *c);

    getchar();
    return 0;
}
ignore the int i; part, i forgot to remove that
with that code i have a int with the value 65 (A when translated to char), i point to it and print out the values, since size of char is 1 byte long i can oly point to the first byte in the int(unless i increment it), but that works and i am able to print A in the screen
i didnt think this was possible, thats why i decided to share
not sure what this is usefull for
 
 
1 hour later…
4:43 PM
what happens if you dont redfine a virtual funciton in a lower class?
 
nwp
5:39 PM
@Permian The class becomes abstract.
@jeyejow It's useful for std::memcpy for example.
Note that the int representation varies, meaning the 65 may not necessarily be stored in the first byte, so the code is not portable.
 
 
5 hours later…
10:33 PM
I have written a proposal to add constexpr parameters to C++. Looking for feedback: github.com/davidstone/isocpp/blob/master/… (I know the formatting isn't very good, but that is just GitHub's markdown parser)
 
1 message moved from Lounge<C++>
 
nwp
@DavidStone Maybe a better fit at cpplang.slack.com
> I will write a separate paper, pending the approval of this proposal, that addresses library impact.
I would not expect approval without addressing library impact.
 
The library impact is limited to "Existing library components can take advantage of this functionality to define new interfaces."
Do you feel that changes anything?
I just know that it can be a fair amount of work to evaluate everything. I don't expect this to have as much library impact as operator<=>, which I did write the library impact paper for (and will be submitting revision 1 on at the next meeting)
 
nwp
Writing separate versions for std::size_t strlen(constexpr char const * s) and std::size_t strlen(char const * s) is something the current design is trying to avoid. Having to do even more overloading to cover all the cases seems to not be a good strategy.
But I don't follow the standardization process closely, so I may be completely wrong.
> Since C++14, we cannot allocate memory in constexpr functions. Once we remove that restriction in C++20, we still cannot reinterpret_cast.
 
The goal of my proposal (and perhaps I did not express this very well) is that library authors can write a constexpr overload if they can do something special with it and the implementation is completely different. They can write a function that forwards constexprness (with the invented syntax of constexpr? in my paper) if most of the implementation is the same, but they need to add one extra piece for one of the two versions (for instance, static_assert vs throw or nothing)
 
nwp
10:48 PM
It's nice to read that they want to get rid of that dumb restriction. I haven't heard of that before.
 
I think this is the most recent version of that paper: open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0784r0.md
And it was well received at the previous meeting
 
nwp
@DavidStone Be careful with that goal. "This is a feature for responsible library authors" doesn't sound very reassuring. I see the use case, and so will many other non-library authors.
 
Fair point
I feel like this is no worse than the existing ability to overload on T & vs T const &, but I also tend to turn those functions into templates when possible (too bad I can't for member functions).
So maybe allowing these parameters to overload with each other is a mistake
If you really want that, you can use the "maybe constexpr" parameter and use if statements
Since my advice would be to rarely write actual overloads
Thanks for looking at it
 

« first day (657 days earlier)      last day (2187 days later) »