Contents of boost::optional<T> are not displayed properly if T is declared in anonymous namespace
Consider this code:
namespace
{
enum class Side { Right, Left };
}
enum class Dir { Up, Down };
int main()
{
auto side = Side::Right; // Displayed ok
boost::optional<Dir> dirOpt = Dir::Up; // Displayed ok
boost::optional<Side> sideOpt = Side::Right; // Displayed raw only
}
Variables side and dirOpt are displayed fine. But variable sideOpt is displayed as there was no natvis installed - raw content is shown only.
Which VS and boost version?
Visual Studio 2015 Update 4. boost 1.58.
Probably it is Visual Studio error:
Error while evaluating '*((enum `anonymous namespace'::Side *)dummy_.data)' in the context of type 'BoostTest.VS2015.exe!boost::optional_detail::aligned_storage<enum `anonymous namespace'::Side>'.
*((enum 'anonymous namespace'::Side*)0) this also doesn't work
Same issue with std::atomic
Is it reported anywhere?
IDK
Could you please either report it, or tell me how did you get this error message?
https://connect.microsoft.com/VisualStudio/feedback/details/3107485
Thanks!
https://developercommunity.visualstudio.com/idea/388773/support-anonymous-namespaces-in-the-debugger.html