Skip to content

Commit

Permalink
Replaced std::pair with struct {first; second;} to avoid constructor …
Browse files Browse the repository at this point in the history
…syntax in initialization
  • Loading branch information
Mikołaj Małecki committed Sep 25, 2017
1 parent 0f8b808 commit bd9c778
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions srtcore/smoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,8 @@ struct Creator

Smoother::NamePtr Smoother::smoothers[N_SMOOTHERS] =
{
NamePtr("live", Creator<LiveSmoother>::Create),
NamePtr("file", Creator<FileSmoother>::Create)
{"live", Creator<LiveSmoother>::Create },
{"file", Creator<FileSmoother>::Create }
};


Expand Down
3 changes: 2 additions & 1 deletion srtcore/smoother.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Smoother
// Note that this is a pointer to function :)

static const size_t N_SMOOTHERS = 2;
typedef std::pair<const char*, smoother_create_t*> NamePtr;
// The first/second is to mimic the map.
typedef struct { const char* first; smoother_create_t* second; } NamePtr;
static NamePtr smoothers[N_SMOOTHERS];

// This is a smoother container.
Expand Down

0 comments on commit bd9c778

Please sign in to comment.