Skip to content

Commit

Permalink
<expected> Implement P0323R12 (microsoft#2643)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephan T. Lavavej <stl@microsoft.com>
Co-authored-by: Casey Carter <Casey@Carter.net>
  • Loading branch information
3 people authored and fsb4000 committed Aug 13, 2022
1 parent 4b8c28c commit 08fefc8
Show file tree
Hide file tree
Showing 13 changed files with 3,275 additions and 25 deletions.
1 change: 1 addition & 0 deletions stl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ set(HEADERS
${CMAKE_CURRENT_LIST_DIR}/inc/deque
${CMAKE_CURRENT_LIST_DIR}/inc/exception
${CMAKE_CURRENT_LIST_DIR}/inc/execution
${CMAKE_CURRENT_LIST_DIR}/inc/expected
${CMAKE_CURRENT_LIST_DIR}/inc/experimental/coroutine
${CMAKE_CURRENT_LIST_DIR}/inc/experimental/deque
${CMAKE_CURRENT_LIST_DIR}/inc/experimental/filesystem
Expand Down
39 changes: 39 additions & 0 deletions stl/debugger/STL.natvis
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,45 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
</Type>


<Type Name="std::unexpected&lt;*&gt;">
<Intrinsic Name="unex" Expression="_Unexpected"/>
<DisplayString>{unex()}</DisplayString>
<Expand>
<Item Name="unex">unex()</Item>
</Expand>
</Type>

<Type Name="std::bad_expected_access&lt;*&gt;">
<Intrinsic Name="unex" Expression="_Unexpected"/>
<DisplayString>{unex()}</DisplayString>
<Expand>
<Item Name="unex">unex()</Item>
</Expand>
</Type>

<Type Name="std::expected&lt;*,*&gt;">
<Intrinsic Name="has_value" Expression="_Has_value"/>
<Intrinsic Name="value" Expression="_Value"/>
<Intrinsic Name="unex" Expression="_Unexpected"/>
<DisplayString Condition="has_value()">{value()}</DisplayString>
<DisplayString Condition="!has_value()">{unex()}</DisplayString>
<Expand>
<Item Condition="has_value()" Name="value">value()</Item>
<Item Condition="!has_value()" Name="unex">unex()</Item>
</Expand>
</Type>

<Type Name="std::expected&lt;void,*&gt;">
<Intrinsic Name="has_value" Expression="_Has_value"/>
<Intrinsic Name="unex" Expression="_Unexpected"/>
<DisplayString Condition="has_value()">void</DisplayString>
<DisplayString Condition="!has_value()">{unex()}</DisplayString>
<Expand>
<Item Condition="!has_value()" Name="unex">unex()</Item>
</Expand>
</Type>


<Type Name="std::bitset&lt;*&gt;">
<DisplayString>{{ size={$T1} }}</DisplayString>
<Expand>
Expand Down
1 change: 1 addition & 0 deletions stl/inc/__msvc_all_public_headers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#include <complex>
#include <deque>
#include <exception>
#include <expected>
#include <filesystem>
#include <format>
#include <forward_list>
Expand Down
Loading

0 comments on commit 08fefc8

Please sign in to comment.