--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CANu6V4W6ahF9QpfwXyb08965XCONdounDV1zf39-OnKNLWq%3DBw%40mail.gmail.com.
std::tuple<double.position, QColor.color> getStop();auto m = getStop();
double pos = m.position;
QColor c = m.color; --
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/19048c95-770c-4413-b5ff-aa405c389621%40isocpp.org.
-- Simon Brand Staff Software Engineer Codeplay Software Ltd Level C, Argyle House, 3 Lady Lawson St, Edinburgh, EH3 9DR Tel: 0131 466 0503 Fax: 0131 557 6600 Website: http://www.codeplay.com Twitter: https://twitter.com/codeplaysoft This email and any attachments may contain confidential and /or privileged information and is for use by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it, or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated. As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments. Company registered in England and Wales, number: 04567874 Registered office: 81 Linkfield Street, Redhill RH1 6BY
Interesting, is that double.position some special syntax exception, or does it generate an anonymous class with a single public data member with the given type and name? Can that be used with existing classes with no changes?
template<class T, declname N>
struct S
{
T N;
};
S<int, ?data> s;
s.data = 0;template<class T>
struct S;
template<class T, declname N>
struct S<T.N> // decompose the designating type
{
T N;
};
S<int.data> s;
s.data = 0;
S<int> s2; // ok, N is unnamed
Hello all,
Using type-tags to access tuple fields is a common technique to access
fields by "name"
std::tuple tup(.foo = 10, .bar = 20); // deduced to std::tuple<int.foo, int.bar>--
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposal...@isocpp.org.
To post to this group, send email to std-pr...@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/5eeef837-6e0f-4544-b610-0474c6aaa02a%40isocpp.org.
On 13 Oct 2016 10:55 am, "Michał Dominiak" <gri...@griwes.info> wrote:
>
> How is that different from a structure? (Assuming we get type deduction for NSDMs, which seems to be much less far fetched than assuming your thing is going to even pass EWG...)
>
It can be used as part of an expression; it allows, among other things for named function arguments; doesn't require auto NSDM which has been shot down already; the generated tuple is introspection friendly (my emulation even provides a string representation of the field name); it uses the same syntax as C99 designated initilalizers and can be used to emulate them; it only requires a well contained language change.
> You received this message because you are subscribed to a topic in the Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit https://groups.google.com/a/isocpp.org/d/topic/std-proposals/UWc3QbxVf0c/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to std-proposal...@isocpp.org.
> To post to this group, send email to std-pr...@isocpp.org.
> To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAPCFJdS7iPJumE%3DbHhChwUrrA20n35j1XJs8-DO9HVMaJa2RxA%40mail.gmail.com.
std::tuple<double.position, QColor.color> getStop();auto m = getStop();
double pos = m.position;
QColor c = m.color;
Range TS has a tagged tuple.
Vicente
What about something similar for variant?
std::variant<double.position,QColor.color>
var_pos_color=std::tuple<double>(1.2);
then:
assert(var_pos_color.position == 1.2);
assert(var_pos_color.color == undefined);
assert(var_pos_color.which == position);