Development

共370篇文章。

How to represent some type inherted from other template, in a C++ template class?

Development

It’s not quite easy to represent a type that is found in base “template class”. Consider the following code:


template <class Key,class T>     class CMyClass: public map<Key,T>{public:    void lookup(Key x)    {        map<Key,T>::iterator iter;         iter = find(x);    }};


阅读全文…:How to represent some type inherted from other template, in a C++ template class?(本文约63字,阅读大致需要1分钟)

magic to build package on different FreeBSD versions

Development

Sometimes you may need to build some packages for older/newer versions of FreeBSD. That is simple if you use jail and other mechanisms.

In order to be successful, you need a “Full jail” say ordinary jail, installed with binary that is built from the target version of FreeBSD. For instance, build a 6.0 userland by sync’ing code to -HEAD.

Secondly, you need to replace two files in the jail: uname(1) and sysctl(1). What you have to do is to use sed to replace both FreeBSD version and __FreeBSDVersion (say, kern.osreldate), according to porters’ handbook.

阅读全文…:magic to build package on different FreeBSD versions(本文约198字,阅读大致需要1分钟)
搜索文章…(按ESC退出)