'Why does this C++ class instantiation work?

My friend showed me this interesting way to instantiate a class object:

Class *instance(new Class(args)).

Mind you, this was quite some time ago, and my friend can't seem to remember, or even understand, why he did it this way, and is genuinely curious as to why this even works. It was when I was still picking up pointers, so I just did the rest of my instantiations like this. Instead of, you know

Class *instance = new Class(args).

It works, but why? I have tried to find an answer to this but I struggle to describe it in a way so that a search engine could assist me.

I include below an example of my class definitions at the time. Perhaps the explanation lies there.

class Spacebox : public Skybox
{
public:
Spacebox(
    glm::vec3 _initPos,
    glm::vec4 _initRotation,
    double _oScale) : Skybox(_initPos, _initRotation, _oScale)
{
    mesh = new Mesh("Skybox.obj");
    shader = new Shader("Skybox");
    std::vector<std::string> faces
    {
            "Skybox/MilkywaySkybox/MWpositiveX.jpg",
            "Skybox/MilkywaySkybox/MWnegativeX.jpg",
            "Skybox/MilkywaySkybox/MWpositiveY.jpg",
            "Skybox/MilkywaySkybox/MWnegativeY.jpg",
            "Skybox/MilkywaySkybox/MWpositiveZ.jpg",
            "Skybox/MilkywaySkybox/MWnegativeZ.jpg"
    };
    texture = new Texture(faces);
}
~Spacebox() {}
}; 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source