Skip to content

Commit

Permalink
*: Fold empty constructor bodies back
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Oct 22, 2023
1 parent 5e84f49 commit dd3b640
Show file tree
Hide file tree
Showing 65 changed files with 167 additions and 334 deletions.
3 changes: 1 addition & 2 deletions asteria/argument_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ class Argument_Reader
Argument_Reader(stringR name, Reference_Stack&& stack) noexcept
:
m_name(name), m_stack(::std::move(stack))
{
}
{ }

private:
inline
Expand Down
3 changes: 1 addition & 2 deletions asteria/binding_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class Binding_Generator
const char* file, int line) noexcept
:
m_name(name), m_params(params), m_file(file), m_line(line)
{
}
{ }

public:
// These functions are invoked by `ASTERIA_BINDING()`.
Expand Down
3 changes: 1 addition & 2 deletions asteria/compiler/expression_unit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ class Expression_Unit
noexcept(::std::is_nothrow_constructible<decltype(m_stor), XUnitT&&>::value)
:
m_stor(::std::forward<XUnitT>(xunit))
{
}
{ }

template<typename XUnitT,
ROCKET_ENABLE_IF(::std::is_assignable<decltype(m_stor)&, XUnitT&&>::value)>
Expand Down
3 changes: 1 addition & 2 deletions asteria/compiler/infix_element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ class Infix_Element
noexcept(::std::is_nothrow_constructible<decltype(m_stor), XElemT&&>::value)
:
m_stor(::std::forward<XElemT>(xelem))
{
}
{ }

template<typename XElemT,
ROCKET_ENABLE_IF(::std::is_assignable<decltype(m_stor)&, XElemT&&>::value)>
Expand Down
3 changes: 1 addition & 2 deletions asteria/compiler/statement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ class Statement
noexcept(::std::is_nothrow_constructible<decltype(m_stor), XStmtT&&>::value)
:
m_stor(::std::forward<XStmtT>(xstmt))
{
}
{ }

template<typename XStmtT,
ROCKET_ENABLE_IF(::std::is_assignable<decltype(m_stor)&, XStmtT&&>::value)>
Expand Down
3 changes: 1 addition & 2 deletions asteria/compiler/statement_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class Statement_Sequence
Statement_Sequence(const Compiler_Options& opts) noexcept
:
m_opts(opts)
{
}
{ }

public:
ASTERIA_NONCOPYABLE_DESTRUCTOR(Statement_Sequence);
Expand Down
3 changes: 1 addition & 2 deletions asteria/compiler/token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ class Token
noexcept(::std::is_nothrow_constructible<decltype(m_stor), XTokT&&>::value)
:
m_sloc(xsloc), m_length(xlen), m_stor(::std::forward<XTokT>(xtok))
{
}
{ }

Token&
swap(Token& other) noexcept
Expand Down
3 changes: 1 addition & 2 deletions asteria/compiler/token_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class Token_Stream
Token_Stream(const Compiler_Options& opts) noexcept
:
m_opts(opts)
{
}
{ }

public:
ASTERIA_NONCOPYABLE_DESTRUCTOR(Token_Stream);
Expand Down
21 changes: 7 additions & 14 deletions asteria/fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,22 +376,19 @@ class cow_opaque
public:
constexpr
cow_opaque(nullptr_t = nullptr) noexcept
{
}
{ }

template<typename OpaqT>
cow_opaque(const refcnt_ptr<OpaqT>& sptr) noexcept
:
m_sptr(sptr)
{
}
{ }

template<typename OpaqT>
cow_opaque(refcnt_ptr<OpaqT>&& sptr) noexcept
:
m_sptr(::std::move(sptr))
{
}
{ }

cow_opaque&
operator=(nullptr_t) &
Expand Down Expand Up @@ -547,29 +544,25 @@ class cow_function
public:
constexpr
cow_function(nullptr_t = nullptr) noexcept
{
}
{ }

constexpr
cow_function(const char* desc, simple_function* fptr) noexcept
:
m_desc(desc), m_fptr(fptr)
{
}
{ }

template<typename FuncT>
cow_function(const refcnt_ptr<FuncT>& sptr) noexcept
:
m_sptr(sptr)
{
}
{ }

template<typename FuncT>
cow_function(refcnt_ptr<FuncT>&& sptr) noexcept
:
m_sptr(::std::move(sptr))
{
}
{ }

cow_function&
operator=(nullptr_t) &
Expand Down
3 changes: 1 addition & 2 deletions asteria/llds/avmc_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class AVMC_Queue
public:
explicit constexpr
AVMC_Queue() noexcept
{
}
{ }

AVMC_Queue(AVMC_Queue&& other) noexcept
{
Expand Down
3 changes: 1 addition & 2 deletions asteria/llds/reference_dictionary.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class Reference_Dictionary
public:
explicit constexpr
Reference_Dictionary() noexcept
{
}
{ }

Reference_Dictionary(Reference_Dictionary&& other) noexcept
{
Expand Down
3 changes: 1 addition & 2 deletions asteria/llds/reference_stack.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ class Reference_Stack
public:
explicit constexpr
Reference_Stack() noexcept
{
}
{ }

Reference_Stack(Reference_Stack&& other) noexcept
{
Expand Down
3 changes: 1 addition & 2 deletions asteria/llds/variable_hashmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class Variable_HashMap
public:
explicit constexpr
Variable_HashMap() noexcept
{
}
{ }

Variable_HashMap(Variable_HashMap&& other) noexcept
{
Expand Down
6 changes: 2 additions & 4 deletions asteria/recursion_sentry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ class Recursion_Sentry
Recursion_Sentry() noexcept
:
m_base(this)
{
}
{ }

explicit constexpr
Recursion_Sentry(const void* base) noexcept
:
m_base(base)
{
}
{ }

Recursion_Sentry(const Recursion_Sentry& other) // copy constructor
:
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/air_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,7 @@ class AIR_Node
noexcept(::std::is_nothrow_constructible<decltype(m_stor), XNodeT&&>::value)
:
m_stor(::std::forward<XNodeT>(xnode))
{
}
{ }

template<typename XNodeT,
ROCKET_ENABLE_IF(::std::is_assignable<decltype(m_stor)&, XNodeT&&>::value)>
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/air_optimizer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class AIR_Optimizer
AIR_Optimizer(const Compiler_Options& opts) noexcept
:
m_opts(opts)
{
}
{ }

public:
ASTERIA_COPYABLE_DESTRUCTOR(AIR_Optimizer);
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/analytic_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Analytic_Context
Analytic_Context(M_plain, Abstract_Context& parent)
:
m_parent_opt(&parent)
{
}
{ }

// A function context may have a parent.
// Names found in ancestor contexts will be bound into the
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/backtrace_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Backtrace_Frame
Backtrace_Frame(Frame_Type xtype, const Source_Location& xsloc, XValT&& xval)
:
m_type(xtype), m_sloc(xsloc), m_value(::std::forward<XValT>(xval))
{
}
{ }

public:
Frame_Type
Expand Down
6 changes: 2 additions & 4 deletions asteria/runtime/executive_context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ class Executive_Context
:
m_parent_opt(&parent), m_global(parent.m_global), m_stack(parent.m_stack),
m_alt_stack(parent.m_alt_stack)
{
}
{ }

// A defer context is used to evaluate deferred expressions.
// They are evaluated in separated contexts, as in case of proper tail calls,
Expand All @@ -48,8 +47,7 @@ class Executive_Context
:
m_parent_opt(nullptr), m_global(&global), m_stack(&stack),
m_alt_stack(&alt_stack), m_defer(::std::move(defer))
{
}
{ }

// A function context has no parent.
// The caller shall define a global context and evaluation stack, both of which
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/garbage_collector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ class Garbage_Collector final
public:
explicit
Garbage_Collector() noexcept
{
}
{ }

private:
inline
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/module_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Module_Loader final
public:
explicit
Module_Loader() noexcept
{
}
{ }

private:
locked_stream_pair*
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/ptc_arguments.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class PTC_Arguments final
const cow_function& target, Reference_Stack&& stack)
:
m_sloc(sloc), m_ptc(ptc), m_target(target), m_stack(::std::move(stack))
{
}
{ }

public:
ASTERIA_NONCOPYABLE_DESTRUCTOR(PTC_Arguments);
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/reference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Reference
// Constructors and assignment operators
constexpr
Reference() noexcept
{
}
{ }

Reference(const Reference& other) noexcept
:
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/reference_modifier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ class Reference_Modifier
noexcept(::std::is_nothrow_constructible<decltype(m_stor), XModT&&>::value)
:
m_stor(::std::forward<XModT>(xmod))
{
}
{ }

template<typename XModT,
ROCKET_ENABLE_IF(::std::is_assignable<decltype(m_stor)&, XModT&&>::value)>
Expand Down
3 changes: 1 addition & 2 deletions asteria/runtime/variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Variable final
public:
explicit
Variable() noexcept
{
}
{ }

public:
ASTERIA_NONCOPYABLE_DESTRUCTOR(Variable);
Expand Down
6 changes: 2 additions & 4 deletions asteria/runtime/variadic_arguer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ class Variadic_Arguer final
Variadic_Arguer(const Source_Location& xsloc, stringR xfunc)
:
m_sloc(xsloc), m_func(xfunc)
{
}
{ }

explicit
Variadic_Arguer(const Variadic_Arguer& other, const cow_vector<Reference>& xvargs)
:
m_sloc(other.m_sloc), m_func(other.m_func), m_vargs(xvargs)
{
}
{ }

public:
const Source_Location&
Expand Down
3 changes: 1 addition & 2 deletions asteria/simple_script.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ class Simple_Script
Simple_Script(API_Version version = api_version_latest)
:
m_global(version)
{
}
{ }

public:
const Compiler_Options&
Expand Down
6 changes: 2 additions & 4 deletions asteria/source_location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ class Source_Location
Source_Location() noexcept
:
m_file(sref("[unknown]")), m_line(-1), m_column(-1)
{
}
{ }

Source_Location(stringR xfile, int xline, int xcolumn) noexcept
:
m_file(xfile), m_line(xline), m_column(xcolumn)
{
}
{ }

Source_Location&
swap(Source_Location& other) noexcept
Expand Down
Loading

0 comments on commit dd3b640

Please sign in to comment.