Skip to content

Commit

Permalink
Add self_ keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Nov 5, 2023
1 parent 7ea1699 commit ac44f40
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/xtd.core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ add_sources(
include/xtd/sbyte
include/xtd/sbyte_object.h
include/xtd/sbyte_object
include/xtd/self.h
include/xtd/self
include/xtd/semaphore.h
include/xtd/semaphore
include/xtd/signal.h
Expand Down
1 change: 1 addition & 0 deletions src/xtd.core/include/xtd/keywords.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "block_scope.h"
#include "interface.h"
#include "nameof.h"
#include "self.h"
#include "startup.h"
#include "typeof.h"
#include "unused.h"
Expand Down
2 changes: 2 additions & 0 deletions src/xtd.core/include/xtd/self
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#pragma once
#include "self.h"
18 changes: 18 additions & 0 deletions src/xtd.core/include/xtd/self.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// @file
/// @brief Contains #self_ keyword.
/// @copyright Copyright (c) 2023 Gammasoft. All rights reserved.
#pragma once

/// @brief The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
namespace xtd {
}

/// @brief The #self_ expression is a reference value expression whose value is the reference of the implicit object parameter (the object on which the non-static member function (up to C++23) implicit object member function (since C++23) is called).
/// @par Namespace
/// xtd
/// @par Library
/// xtd.core
/// @ingroup xtd_core keywords
/// @remarks #selt_ is equivalent to *this.
#define self_\
(*this)
1 change: 1 addition & 0 deletions src/xtd.core/include/xtd/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/// @copyright Copyright (c) 2023 Gammasoft. All rights reserved.
#pragma once
#include "core_export.h"
#include "self.h"
/// @cond
#define __XTD_VALUE_TYPE_NATIVE__
#include <xtd/native/value_types>
Expand Down
1 change: 1 addition & 0 deletions src/xtd.core/include/xtd/xtd.core.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@
#include "reset_color.h"
#include "sbyte.h"
#include "sbyte_object.h"
#include "self.h"
#include "signal.h"
#include "signal_cancel_event_args.h"
#include "signal_cancel_event_handler.h"
Expand Down

0 comments on commit ac44f40

Please sign in to comment.