~ubuntu-branches/ubuntu/trusty/bmagic/trusty

« back to all changes in this revision

Viewing changes to src/bmutil.h

  • Committer: Bazaar Package Importer
  • Author(s): Roberto C. Sanchez
  • Date: 2010-04-08 16:47:58 UTC
  • mfrom: (4.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100408164758-3vu6wmrk1dnzqnnj
Tags: 3.6.4-1
* New upstream release
* Update to Standards-Version 3.8.4 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "bmdef.h"
30
30
#include "bmconst.h"
31
31
 
 
32
#if defined(_M_AMD64) || defined(_M_X64) 
 
33
#include <intrin.h>
 
34
#endif
 
35
 
32
36
namespace bm
33
37
{
34
38
 
84
88
    return l;
85
89
}
86
90
 
87
 
 
 
91
/**
 
92
     Mini auto-pointer for internal memory management
 
93
     @internal
 
94
*/
 
95
template<class T>
 
96
class ptr_guard
 
97
{
 
98
public:
 
99
    ptr_guard(T* p) : ptr_(p) {}
 
100
    ~ptr_guard() { delete ptr_; }
 
101
private:
 
102
    ptr_guard(const ptr_guard<T>& p);
 
103
    ptr_guard& operator=(const ptr_guard<T>& p);
 
104
private:
 
105
    T* ptr_;
 
106
};
88
107
 
89
108
/**
90
109
    Lookup table based integer LOG2