Skip to main content

Blogs

Placement new operator

Posted in

void *buf = reinterpret_cast<void*>(0xf01f);
 
X *x = new (buf) X;

Corrupted reference

Posted in

One of the things that differs a reference from a pointer is the fact that any reference MUST be initialized (just like constants). One might think that this guarantees safe usage of references.

Qt 4.5 on FreeBSD

Posted in

As soon as I found out that Qt 4.5.0 was released I wanted it installed on my FreeBSD.

FreeBSD loader logo

Posted in

Remember those days, when you could see nice ASCII-style Beastie when your FreeBSD start up? I remember that when i used to work with FreeBSD 5.3. With new major releases, such as 6 and 7, the default logo is an ASCII word 'FreeBSD'.

If you look into /boot/beastie.4th you will see that all available logos are defined here.

The acceptable logos are:

  • fbsdbw
  • beastie
  • beastiebw
  • none

So if you want to change the default logo, just put the following line in you /boot/loader.conf (I have chosen 'beastiebw')

Return const reference

Posted in

class Q
{
    public:
        Q() { x = 7;}
 
        int& getX() { return x; }
    private:
        int x;
};

First blog entry

Welcome to lyuts.net, the blog-site on various topic: algorithms, C++, FreeBSD and Unix in general, vim, and lots of other things that may be of some interest for me (And hope, that of some interest for you.)
This blog used to be located at lyuts.blogspot.com.

Syndicate content