Can I initialize virtual functions outside a class?

I want to know if i can initialize a virtual function outside a class, the function will have a lot of code and I don't want to clutter up my class.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <SFGUI/SFGUI.hpp>
#include <SFML/Graphics.hpp>

#include <iostream>
#include <string>
#include <vector>

using namespace std;

class App
{
    public:
        void Program();
        virtual void Window();

    private:
        sfg::SFGUI sfgui;
        sfg::Desktop dtop;
        sfg::Window::Ptr main_window;
};

class SFGUIWindow
{
    public:
        virtual void Window();

    private:

};

void SFGUIWindow::Window()
{

}

int main()
{

    return 0;
}
bump
Topic archived. No new replies allowed.