create class and function in one header file without library : <p>Hello i want to create my own public c++ tool like auto socket connection. but i have two ways and i want to know which way is better.
way 1 :
insert the functions (with source) inside one header file and other people just include the header file and use the functions... 
<br><strong>sock.h</strong></p>

<pre><code>#include &lt;iostream&gt;

class sock {

    public:

    bool create();
    bool bind();
    bool listen();
}

inline bool sock::create() { ... }
inline bool sock::bind() { ... }
inline bool sock::listen() { ... }
</code></pre>

<p>and second way is create a header file and also create static lib (c++)
<br><strong>sock.h</strong></p>

<pre><code>#include &lt;iostream&gt;

class sock {

    public:

    bool create();
    bool bind();
    bool listen();
}
</code></pre>

<p><strong>sock.cpp</strong></p>

<pre><code>#include "sock.h"

bool sock::create() { ... }
bool sock::bind() { ... }
bool sock::listen() { ... }
</code></pre>

<p>which way is better ? ( i choose the first way myself because it's easy for client to just include one header file and use the functions but in second way client must include the header and also include the lib file. is there any problem for first way?</p>
