Skip to content

Commit

Permalink
TEST lambda evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Sep 11, 2023
1 parent 7aed8b2 commit 34306d0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Bar/src/Bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,12 @@ std::string Bar::operator()() const {
return std::string{"\"Bar\":{\"int\":"} + std::to_string(_intValue) +
",\"int64\":" + std::to_string(_int64Value) + "}";
}

namespace {
void* kVar = [] {
std::cerr << "kBar" << std::endl;
return nullptr;
}();
} // namespace

} // namespace bar
7 changes: 7 additions & 0 deletions Foo/src/Foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,11 @@ std::string Foo::operator()() const {
",\"int64\":" + std::to_string(_int64Value) + "}";
}

namespace {
void* kVar = [] {
std::cerr << "kFoo" << std::endl;
return nullptr;
}();
} // namespace

} // namespace foo
5 changes: 5 additions & 0 deletions FooBarApp/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
#include <iostream>
#include <string>

void* kVar = [] {
std::cerr << "kFooBarApp\n";
return nullptr;
}();

int main(int /*argc*/, char** /*argv*/) {
foobar::freeFunction(int{0});
std::cout << std::endl;
Expand Down

0 comments on commit 34306d0

Please sign in to comment.