Skip to content

Commit

Permalink
add: change access modifier offset
Browse files Browse the repository at this point in the history
  • Loading branch information
ObiWahn committed Feb 17, 2024
1 parent 0b19d38 commit 48573d6
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Language: Cpp
AccessModifierOffset: 0
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Expand Down
2 changes: 1 addition & 1 deletion include/ext/memory/tagged_pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class tagged_pointer {
return ret | (tag & mask);
};

public:
public:
static constexpr std::uintptr_t alignment = Alignment;
static constexpr std::uintptr_t mask = Alignment - 1;

Expand Down
4 changes: 2 additions & 2 deletions include/ext/structures/binary_index_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ inline void bit_set(Iterator begin, Iterator end, std::size_t index, T value) {

template <typename T>
class binary_index_tree {
public:
public:
binary_index_tree(std::size_t size = 8) {
std::size_t new_size = size;

Expand Down Expand Up @@ -159,7 +159,7 @@ class binary_index_tree {
return _storage;
}
#endif // EXT_STRUCTURES_BINARY_INDEX_TREE_TEST
private:
private:
void grow_fill(std::size_t index) {
if (index >= _storage.size()) {
EXT_ASSERT(ext::util::is_power_of_two(_storage.size()));
Expand Down
4 changes: 2 additions & 2 deletions include/ext/structures/lru_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ext::structures {

template <typename Key, typename Value>
class lru_cache {
public:
public:
lru_cache(size_t max_size) : _max_size{max_size} {}
lru_cache(lru_cache const&) = delete;

Expand Down Expand Up @@ -175,7 +175,7 @@ class lru_cache {
return _map.size();
}

private:
private:
std::list<std::pair<Key, Value>> _list;
std::unordered_map<Key, decltype(_list.begin())> _map;
size_t _max_size;
Expand Down
2 changes: 1 addition & 1 deletion include/ext/util/defer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct defer {
}
}

private:
private:
Functor functor;
bool active;

Expand Down
8 changes: 4 additions & 4 deletions include/ext/util/except.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace ext { namespace util {
*/

class not_implemented_exception : public std::logic_error {
public:
public:
explicit not_implemented_exception() : std::logic_error("not implemented"){};
explicit not_implemented_exception(std::string const& arg) : std::logic_error(arg){};
explicit not_implemented_exception(char const* arg) : std::logic_error(arg){};
Expand All @@ -24,7 +24,7 @@ class not_implemented_exception : public std::logic_error {
};

class debug_exception : public std::logic_error {
public:
public:
explicit debug_exception(std::string const& arg) : std::logic_error(arg){};
explicit debug_exception(char const* arg) : std::logic_error(arg){};
debug_exception(debug_exception const&) = default;
Expand All @@ -35,7 +35,7 @@ class debug_exception : public std::logic_error {
};

class permission_denied_exception : public std::runtime_error {
public:
public:
explicit permission_denied_exception(std::string const& arg) : std::runtime_error(arg){};
explicit permission_denied_exception(char const* arg) : std::runtime_error(arg){};
permission_denied_exception(permission_denied_exception const&) = default;
Expand All @@ -46,7 +46,7 @@ class permission_denied_exception : public std::runtime_error {
};

class cat_not_connect_exception : public std::runtime_error {
public:
public:
explicit cat_not_connect_exception(std::string const& arg) : std::runtime_error(arg){};
explicit cat_not_connect_exception(char const* arg) : std::runtime_error(arg){};
cat_not_connect_exception(cat_not_connect_exception const&) = default;
Expand Down
2 changes: 1 addition & 1 deletion include/ext/util/memstream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct imemstream : std::basic_istream<T> {
this->init(&buffer);
}

private:
private:
membuf<T> buffer;
};

Expand Down
4 changes: 2 additions & 2 deletions include/ext/util/result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ struct typed_result {
value_type value;
bool valid = true;

private:
private:
result _result;

public:
public:
//// constructors
typed_result() = default;

Expand Down
8 changes: 4 additions & 4 deletions include/ext/util/scoped_timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ inline void default_callback(scoped_timer_timings const& times) {

template <typename callback_type>
class scoped_timer {
public:
public:
using clock = std::chrono::high_resolution_clock;
using clock_string_vec = std::vector<std::pair<clock::time_point, std::string>>;

private:
private:
callback_type callback;
clock_string_vec timepoints_with_description;
bool enabled_in_dtor = true;
bool add_dtor_entry = true;

public:
public:
scoped_timer(callback_type cb = &_detail::scoped_timer::default_callback, std::string const& name = ""s)
: callback(cb) {
init(name);
Expand Down Expand Up @@ -172,7 +172,7 @@ class scoped_timer {
}
}

private:
private:
// get difference between time-points in nanoseconds
static std::uint64_t get_time_diff(clock::time_point const& t0, clock::time_point const& t1) {
return static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count());
Expand Down
2 changes: 1 addition & 1 deletion include/ext/util/tracing_classes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class tracing_class {
T _value;
static unsigned const _width = 28;

public:
public:
// default constructor
tracing_class() : _value() {
std::cout << std::setw(_width) << "Default Constructor:" << _value << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion tests/algorithm_longest_common_subsequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace ext { namespace algorithm {
class algorithm_longest_common_subsequence : public ::testing::Test {
protected:
protected:
void test_function(std::pair<std::string, std::string> sequences,
std::size_t expected_lenght,
std::string expected_common) {
Expand Down
2 changes: 1 addition & 1 deletion tests/algorithm_string_distances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace ext { namespace algorithm { namespace distances {
class string_distance_fixture : public ::testing::Test {
protected:
protected:
typedef std::vector<std::pair<std::string, std::string>> test_data_type;
test_data_type test_data;
string_distance_fixture() {
Expand Down

0 comments on commit 48573d6

Please sign in to comment.