Is there any way to understand the meaning of _Ux, _Dx, _Dt here? This mnemonics tells me nothing about parameters.
-
1Removing provocative words like balderdash from the question might avoid down votes, and maybe adding some sample code would help – doctorlove Sep 04 '13 at 08:33
-
3Try a [reference](http://en.cppreference.com/w/cpp/memory/shared_ptr/shared_ptr) documenting `shared_ptr` instead of relying on intellisense – Jonathan Wakely Sep 04 '13 at 08:34
-
1This is obvious, but finally guys from Microsoft use this notation for some reason... – Qué Padre Sep 04 '13 at 08:36
-
http://msdn.microsoft.com/en-us/library/aa260976(v=vs.60).aspx – doctorlove Sep 04 '13 at 08:37
-
5@doctorlove What does Hungarian notation have to do with what he's seeing? – James Kanze Sep 04 '13 at 08:37
-
3@JamesKanze nothing : I need to be quiet and drink my coffee. Sorry everyone – doctorlove Sep 04 '13 at 08:38
-
`_Ux` is the first template parameter, in your case `string`, `_Dx` is the second (default) template parameter. – Roger Rowland Sep 04 '13 at 08:42
-
2@RogerRowland The OP is aware of that, he wants to understand the naming convention leading to the types and parameter names we see here – Hulk Sep 04 '13 at 08:45
-
They're abbreviations. http://msdn.microsoft.com/en-us/library/vstudio/bb982026.aspx shows that D stands for deleter, etc. – Sep 04 '13 at 08:47
-
3@Hulk OP wants to understand MS naming conventions? Well, good luck with that ;-) – Roger Rowland Sep 04 '13 at 08:49
-
1@RogerRowland What is wrong with that? Why do I need hints which I can not understand? – Qué Padre Sep 04 '13 at 08:51
-
Seems more like OP is complaining than asking a real question. I already pointed out D probably stands for deleter, and U and P probably stand for Unique Pointer. If Intellisense isn't helpful, you'll have to consult some form of documentation anyway. – Sep 04 '13 at 08:56
-
@remyabel This is a real question. I just want to be more comfortable writing code. If this is impossible - I have to know that as well. – Qué Padre Sep 04 '13 at 08:58
-
You can always configure the IDE if you are unhappy with it. – Sep 04 '13 at 08:58
-
@remyabel That means that there is a way to configure the IDE to get more useful info (in relation to this particular topic) or what? – Qué Padre Sep 04 '13 at 09:03
-
Intellisense gets its information from somewhere. Whether it's auto-documentation, or pulling it from MSDN. I don't use Visual Studio so I'm not 100% sure, but you might be able to point it towards a reference site with better variable names. – Sep 04 '13 at 09:04
2 Answers
These "mnemonics" as you call it are nothing but a hint generated by Visual Studio's IntelliSense that is meant to help you while writing the code (syntax) rather than the meaning (semantics).
If you need more information to help you understand the API and its proper usage, you should rather consult the documentation. In this case it might be the reference for std::shared_ptr
's constructor

- 41,190
- 11
- 99
- 167
This "weird names" thing has (at least partly) to do with reserved identifiers. The programmer (you, me) is not allowed to define names like _Ux
that begin with an underscore followed by a capital letter (nor names like __x
or a__b
that contain adjacent underscores) anywhere in his source code. The C++ implementation (Standard Library details, compiler internals...) can thus use this reserved "name space" without fearing name clashes with user code.
That's a win-win: the implementation will never define names like fooBar
or FOO_BAR
(set aside keywords like int
and public names like std
, printf
or CHAR_BIT
), so you can safely use these names in your code, and reciprocally you should never define names like _FooBar
, __foo_bar
or FOO__BAR
, so that you won't mess up with the implementation (this is especially true for macros).
As for why they use _Ux * _Px, _Dx _Dt
and not e.g. _U * __p, _Deleter __d
(also _Ty
and not _T
), well, I guess that it's simply their internal naming conventions.