mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
inherit privately from noncopyable, add algos, use namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1933 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
53cf203fb9
commit
998cee223a
@ -1,3 +1,10 @@
|
||||
2001-04-17 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* lyxalgo.h: put into namespace lyx, add firster and copy_if
|
||||
|
||||
* FileInfo.h: inherit privately from noncopyable
|
||||
* path.h: ditto
|
||||
|
||||
2001-04-16 Allan Rae <rae@lyx.org>
|
||||
|
||||
* tempname.C (make_tempfile): #warning triggers an error on Sun CC 6.0
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
/** Use objects of this class to get information about files.
|
||||
*/
|
||||
class FileInfo : public boost::noncopyable {
|
||||
class FileInfo : boost::noncopyable {
|
||||
public:
|
||||
///
|
||||
FileInfo();
|
||||
|
@ -3,7 +3,10 @@
|
||||
#ifndef LYX_ALGO_H
|
||||
#define LYX_ALGO_H
|
||||
|
||||
//namespace lyx {
|
||||
#include <utility>
|
||||
|
||||
namespace lyx {
|
||||
|
||||
|
||||
/// Returns true if the sequence first,last is sorted, false if not.
|
||||
template <class For>
|
||||
@ -17,6 +20,7 @@ bool sorted(For first, For last)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// Cmp is the same Cmp as you would pass to std::sort.
|
||||
template <class For, class Cmp>
|
||||
bool sorted(For first, For last, Cmp cmp)
|
||||
@ -29,5 +33,26 @@ bool sorted(For first, For last, Cmp cmp)
|
||||
return true;
|
||||
}
|
||||
|
||||
// } // end of namespace lyx
|
||||
|
||||
struct firster {
|
||||
template <class P1, class P2>
|
||||
P1 operator()(std::pair<P1, P2> const & p) {
|
||||
return p.first;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <class InputIter, class OutputIter, class Func>
|
||||
OutputIter copy_if(InputIter first, InputIter last,
|
||||
OutputIter result, Func func)
|
||||
{
|
||||
for (; first != last; ++first) {
|
||||
if (func(*first)) {
|
||||
*result++ = *first;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} // end of namespace lyx
|
||||
#endif
|
||||
|
@ -12,7 +12,7 @@
|
||||
#endif
|
||||
|
||||
///
|
||||
class Path : public boost::noncopyable {
|
||||
class Path : boost::noncopyable {
|
||||
public:
|
||||
///
|
||||
explicit
|
||||
|
Loading…
Reference in New Issue
Block a user