I'm trying to learn C++ and I'm experimenting with the std::bind function of the standard library. As a result, I understood that std::bind allows to wrap a function and to partially apply the function. This works very well with functions that are not member functions of a class. Now I try to use std::bind with class member functions and the 'this' pointer but I can't compile and don't know how to fix this problem. Could someone help me to really understand std::bind ?
#include <iostream>
#include <functional>
class Class1 {
    public:
        Class1() = default;
        ~Class1() = default;
        void print(std::function<void(void)> function2) {
            function2();
        };
};
class Class2 {
    public:
        Class2() = default;
        ~Class2() = default;
        void test_bind() {
            std::function<void(void)> function2 = std::bind<void(void)>(&Class2::print, this);
            class1.print(function2);
        }
        void print() {
            std::cout << "CLASS 2" << std::endl;
        };
        Class1 class1;
};
int main(int ac, char **av)
{
    Class2 class2;
    class2.test_bind();
}
 
    