samedi 4 septembre 2021

The difference between two declarations of deleted function

I have this class widget:

class widget_11 {
public:
    template<typename T>
    void process_pointer(T* ptr)
    {
        std::cout << *ptr;
    }
    
};

my issue is that I don't understand whats the difference between these two declarations:

 template<>
 void widget_11::process_pointer(double*) = delete;
 template<>
 void widget_11::process_pointer<double>(double*) = delete;

My question is if these two definitions of deleted functions do the same thing? From my testing they both compile and didn't change how code works, but maybe I skipped something important while testing

Aucun commentaire:

Enregistrer un commentaire