c++-tr2

C++11 filesystem (VS2012)

♀尐吖头ヾ 提交于 2019-12-19 14:44:33
问题 I am having a lot of trouble finding any documentation on the header included with vs2012. I see that it is mentioned here but they don't provide a link on how to use it. What I am really looking for is documentation for how to use it, with the visual studio implementation being preferred. Thanks 回答1: The <filesystem> header is not part of C++11; it is a proposal for C++ TR2 based on the Boost.Filesystem library. Visual C++ 2012 includes an implementation of the proposed library. See the MSDN

What is the status of N2965 - std::bases and std::direct_bases?

丶灬走出姿态 提交于 2019-12-17 06:50:26
问题 I'm writing a template which really needs to know about all the base classes of its parameter type. The std::bases trait proposed by N2965 is perfect for this, however I can't find any reliable information about its status. Is this proposal still alive? If so, when might we be likely to see it, standardized? If not, are there any other proposals around that would provide this capability? As a follow-up, g++ has the two N2965 traits available as std::tr2::bases and std::tr2::direct_bases . Are

How should one use std::optional?

我的梦境 提交于 2019-12-03 18:22:23
问题 I'm reading the documentation of std::experimental::optional and I have a good idea about what it does, but I don't understand when I should use it or how I should use it. The site doesn't contain any examples as of yet which leaves it harder for me to grasp the true concept of this object. When is std::optional a good choice to use, and how does it compensate for what was not found in the previous Standard (C++11). 回答1: The simplest example I can think of: std::optional<int> try_parse_int

C++11 filesystem (VS2012)

允我心安 提交于 2019-12-01 15:43:21
I am having a lot of trouble finding any documentation on the header included with vs2012. I see that it is mentioned here but they don't provide a link on how to use it. What I am really looking for is documentation for how to use it, with the visual studio implementation being preferred. Thanks The <filesystem> header is not part of C++11; it is a proposal for C++ TR2 based on the Boost.Filesystem library. Visual C++ 2012 includes an implementation of the proposed library. See the MSDN documentation for the <filesystem> header and the C++ TR2 proposal on which the implementation is based

How should one use std::optional?

北城以北 提交于 2019-11-29 18:44:15
I'm reading the documentation of std::experimental::optional and I have a good idea about what it does, but I don't understand when I should use it or how I should use it. The site doesn't contain any examples as of yet which leaves it harder for me to grasp the true concept of this object. When is std::optional a good choice to use, and how does it compensate for what was not found in the previous Standard (C++11). Timothy Shields The simplest example I can think of: std::optional<int> try_parse_int(std::string s) { //try to parse an int from the given string, //and return "nothing" if you

using tr2::direct_bases get nth element of result

时光怂恿深爱的人放手 提交于 2019-11-29 15:44:19
struct T1 {}; struct T2: T1 {}; typedef tr2::direct_bases<T2>::type NEW_TYPE ; should return my something like a touple to bases types. How can I get the nth element of this __reflection_typelist<...>. I search for something like tuple_element for the reflection list. You can use this simple metafunction to turn the typelist into an std::tuple : #include <tr2/type_traits> #include <tuple> template<typename T> struct dbc_as_tuple { }; template<typename... Ts> struct dbc_as_tuple<std::tr2::__reflection_typelist<Ts...>> { typedef std::tuple<Ts...> type; }; At this point, you could work with it as

Is TR2 Going to be Released in C++17?

旧时模样 提交于 2019-11-29 11:27:27
There is lots of sweet stuff in TR2 . Is that going to be in C++17 ? I understand that TR1 was completed in 2005 and had to wait until C++11 to be standardized. But I also understand that TR2 is already complete? My link to C++17 doesn't mention anything about TR2, but I am hoping... Yakk - Adam Nevraumont Maybe. The point of TR (and now technical specifications) is to allow something to mature independent of the standard iteration process. They can publish a TS, see how it works, see if there are any problems in the implementation and/or use of the feature, and if everything works they can

using tr2::direct_bases get nth element of result

你离开我真会死。 提交于 2019-11-28 09:23:11
问题 struct T1 {}; struct T2: T1 {}; typedef tr2::direct_bases<T2>::type NEW_TYPE ; should return my something like a touple to bases types. How can I get the nth element of this __reflection_typelist<...>. I search for something like tuple_element for the reflection list. 回答1: You can use this simple metafunction to turn the typelist into an std::tuple : #include <tr2/type_traits> #include <tuple> template<typename T> struct dbc_as_tuple { }; template<typename... Ts> struct dbc_as_tuple<std::tr2:

Is TR2 Going to be Released in C++17?

試著忘記壹切 提交于 2019-11-28 04:41:54
问题 There is lots of sweet stuff in TR2. Is that going to be in C++17? I understand that TR1 was completed in 2005 and had to wait until C++11 to be standardized. But I also understand that TR2 is already complete? My link to C++17 doesn't mention anything about TR2, but I am hoping... 回答1: Maybe. The point of TR (and now technical specifications) is to allow something to mature independent of the standard iteration process. They can publish a TS, see how it works, see if there are any problems

Which boost libraries are heading for TR2?

孤者浪人 提交于 2019-11-27 17:28:44
问题 If found this quote at boost.org: More Boost libraries are in the pipeline for TR2 It links to the TR2 call from proposals. But I can't seem to find any other information on which boost libraries are headed for TR2. I've seen a draft proposal for Boost.Asio, and I vaguely remember seeing something about Boost.System and Boost.Filesystem being proposed as well. Which boost libraries are headed for TR2? What else has been proposed for the TR2? Are there any good sources of information for this?