Skip to content

Commit

Permalink
Fixed: Use of local type in a template
Browse files Browse the repository at this point in the history
We are currently using C++03, and the standard says:

> A local type, a type with no linkage, an unnamed type or a type
> compounded from any of these types shall not be used as a
> template-argument for a template type-parameter.

See: http://stackoverflow.com/questions/5751977/local-type-as-template-arguments-in-c
  • Loading branch information
skyjake committed Oct 12, 2012
1 parent 8ad7d7c commit 5e1635e
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions doomsday/engine/portable/src/fs_main.cpp
Expand Up @@ -760,6 +760,23 @@ int FS::findAll(bool (*predicate)(de::DFile* hndl, void* parameters), void* para
return numFound;
}

struct PathListItem
{
String path;
int attrib;

PathListItem(QString const& _path, int _attrib = 0)
: path(_path), attrib(_attrib)
{}

bool operator < (PathListItem const& other) const
{
return path.compareWithoutCase(other.path) < 0;
}
};

typedef QList<PathListItem> PathList;

int FS::allResourcePaths(char const* rawSearchPattern, int flags,
int (*callback) (char const* path, PathDirectoryNodeType type, void* parameters),
void* parameters)
Expand Down Expand Up @@ -843,20 +860,6 @@ int FS::allResourcePaths(char const* rawSearchPattern, int flags,

if(!Str_IsEmpty(searchDirectory))
{
struct PathListItem
{
String path;
int attrib;
PathListItem(QString const& _path, int _attrib = 0)
: path(_path), attrib(_attrib)
{}
bool operator < (PathListItem const& other) const
{
return path.compareWithoutCase(other.path) < 0;
}
};
typedef QList<PathListItem> PathList;

PathList foundPaths;
AutoStr* wildPath = AutoStr_NewStd();
finddata_t fd;
Expand Down

0 comments on commit 5e1635e

Please sign in to comment.