Writing native visualizer for wrapper of unique_ptr

  • Thread starter Thread starter Acrym
  • Start date Start date
A

Acrym

Guest
I have a wrapper class around std::unique_ptr (simplified for brevity):

template <typename T>
class DeepPtr {
std::unique_ptr<T> data;
};



I'm trying to create a .natvis file to basically have the visualization of data.

<Type Name="DeepPtr">
<DisplayString>
{data}
</DisplayString>
</Type>


But, it doesn't work. I get the following errors in the natvis output:

Natvis: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Packages\Debugger\Visualizers\stl.natvis(288,37): Error: unrecognized token
Error while evaluating '_Mypair._Myval2' in the context of type 'std::unique_ptr<boost::filesystem::path,std::default_delete<boost::filesystem::path> >'.



I have no problems when just showing a unique_ptr. It's only a problem if it's a wrapper around a unique_ptr.

Continue reading...
 
Back
Top