Skip to content

Commit

Permalink
fix: constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
vinniefalco committed Jun 21, 2023
1 parent 9744bf6 commit 181ac6b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions source/-adoc/AdocGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ buildOne(
std::vector<Error> errors;

ex->async(
[this, &os](Builder& builder)
[&os](Builder& builder)
{
auto pageText =
builder.renderSinglePageHeader();
Expand All @@ -107,7 +107,7 @@ buildOne(
return Error(errors);

ex->async(
[this, &os](Builder& builder)
[ &os](Builder& builder)
{
auto pageText =
builder.renderSinglePageFooter();
Expand Down
7 changes: 4 additions & 3 deletions source/-adoc/MultiPageVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ namespace clang {
namespace mrdox {
namespace adoc {

template<class T>
void
MultiPageVisitor::
operator()(auto const& I)
operator()(T const& I)
{
renderPage(I);
if constexpr(
I.isNamespace() ||
I.isRecord())
T::isNamespace() ||
T::isRecord())
corpus_.traverse(I, *this);
}

Expand Down
3 changes: 2 additions & 1 deletion source/-adoc/MultiPageVisitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ class MultiPageVisitor
{
}

void operator()(auto const& I);
template<class T>
void operator()(T const& I);
void renderPage(auto const& I);
};

Expand Down
7 changes: 4 additions & 3 deletions source/-adoc/SinglePageVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ namespace clang {
namespace mrdox {
namespace adoc {

template<class T>
void
SinglePageVisitor::
operator()(auto const& I)
operator()(T const& I)
{
renderPage(I, numPages_++);
if constexpr(
I.isNamespace() ||
I.isRecord())
T::isNamespace() ||
T::isRecord())
corpus_.traverse(I, *this);
}

Expand Down
3 changes: 2 additions & 1 deletion source/-adoc/SinglePageVisitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class SinglePageVisitor
{
}

void operator()(auto const& I);
template<class T>
void operator()(T const& I);
void renderPage(auto const& I, std::size_t pageNumber);
void endPage(std::string pageText, std::size_t pageNumber);
};
Expand Down
7 changes: 2 additions & 5 deletions test-files/adoc/test.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
int i;
void* j = nullptr;

/** brief
desc
*/
static char c = 0;
void f();

0 comments on commit 181ac6b

Please sign in to comment.