Skip to content

Commit

Permalink
Updating documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gershnik committed Jan 10, 2024
1 parent f1930ba commit f94cdc3
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions include/objc-helpers/BoxUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@


/**
Marks that NSObject conforming to it is a boxed C++ object
Signifies that NSObject conforming to it is a boxed C++ object
*/
@protocol BoxedValue<NSObject>
@end

/**
Marks that NSObject conforming to it can be comapred to others of the same type
Signifies that NSObject conforming to it can be comapred to others of the same type
*/
@protocol BoxedComparable<NSObject>
- (NSComparisonResult) compare:(id<BoxedComparable> __nonnull)other;
Expand Down Expand Up @@ -319,6 +319,13 @@ class __attribute__((visibility("hidden"))) BoxMaker {
/**
Box a value emplacing it.
@param args arguments to forward to the constructor of T
@return `NSObject<BoxedValue, other protocols> *`
Additional protocols are as follows:
- `BoxedComparable` if the boxed value is `std::totally_ordered`
- `NSCopying` if the boxed value has copy constructor
Call it like this:
@code
//this constructs a boxed vector of 7 chars 'a'
Expand All @@ -334,10 +341,11 @@ inline auto box(Args &&... args) -> BoxMaker<T>::BoxedType
/**
Box a value via copy or move
@return NSObject\<BoxedValue, other protocols\> \* object where other protocols are as follows
@return `NSObject<BoxedValue, other protocols> *`
- BoxedComparable if the boxed value can be `<=>` compared producing strong ordering
- NSCopying if the boxed value has copy constructor
Additional protocols are as follows:
* `BoxedComparable` if the boxed value is `std::totally_ordered`
* `NSCopying` if the boxed value has copy constructor
Call it like this:
@code
Expand Down

0 comments on commit f94cdc3

Please sign in to comment.