Question: I have the following class:

```
class Component
{
    ComponentType ComponentType {get; set;}
    string Name {set; set;}
    List<Component> SubComponents {get; set;}
}

enum ComponentType
{
    Feature,
    Role
}

```

And on my VM a `List<Component> AllComponents {get;}` that contains *all* of my components, regardless of `ComponentType`.

I would like to, without having to separate my `Component` by `ComponentType`, display them in a `TreeView` as such:

```
Roles
    ComponentA
    ComponentB
        ComponentC
        ComponentD
    ComponentE
Features
    ComponentF
    ComponentG
        ComponentH
    ComponentI

```

But I'm really unsure how to do this in WPF without having to create two separate `List<Component>` or a `Dictionary<ComponentType, Component>` (which I would also like to avoid).

So pretty simple question, is there a way to achieve this with just XAML?

PS: All `SubComponents` will always have the same `ComponentType` as their parents.

Answer: 
Take this code:

```
MoveAssignOnly_V2<int, float> lhs;
MoveAssignOnly_V2<int, double> rhs;
lhs = stdL::move(rhs);

```

When the converting constructor (note that it's *not* a move constructor) is not there, there is no way to assign `rhs` into `lhs`.

However, when you add the constructor template, there is now a way to convert `rhs` into the type `MoveAssignOnly_V2<int, float>` (which creates a temporary of that type). Then, it's possible to move-assign from that temporary into `lhs`.

This is the same principle as:

```
double lhs = 3.14;
float rhs = 42.f;
lhs = std::move(rhs);

```

To address the update in the question:

You cannot go with function declarations alone, you have to read the full specification (in the standard or [suitable reference](https://en.cppreference.com/w/cpp/memory/unique_ptr/unique_ptr)). Quoting the linked reference about the converting constructor of `std::unique_ptr`:

> 
> This constructor only participates in overload resolution if all of the following is true:
> 
> 
> a) `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer`  
> 
> b) `U` is not an array type  
> 
> c) Either `Deleter` is a reference type and `E` is the same type as `D`, or `Deleter` is not a reference type and `E` is implicitly convertible to `D`
> 
> 
> 

So as you can see, the `unique_ptr`'s converting constructor must be implemented so that it's only active if the source deleter can be converted to the target one. That's basically the same rule as for move assignment in the previous question.
What you added here:

```
template<class U, class E>
MoveAssignOnly_V2(MoveAssignOnly_V2<U, E>&& m) noexcept {}

```

is not only a move constructor, but a templated constructor that can construct `MoveAssignOnly_V2<T, D>` from any `MoveAssignOnly_V2<U, E>`.

Thus constructing `MoveAssignOnly_V2<int, float>` from `MoveAssignOnly_V2<int, double>>` is fine.