This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
int main(int argc, const char * argv[]) { | |
// Pointer | |
{ | |
const std::vector<int>* pArray = new std::vector<int>(); | |
std::vector<int> const* pArray2 = new std::vector<int>(); | |
std::vector<int>* const pArrayMutable = new std::vector<int>(); | |
pArray->push_back(9999); // error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#include <string> | |
#include <vector> | |
@interface ObjcClass: NSObject | |
@property (nonatomic, readonly) NSString *name; | |
- (instancetype)initWithName:(NSString *)name; | |
- (void)speak; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#include <string> | |
#include <memory> | |
@interface ObjcClass: NSObject | |
@property (nonatomic, readonly) NSString *string; | |
- (instancetype)initWithString:(NSString *)string; | |
- (void)speak; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#include <string> | |
#include <memory> | |
class CppClass { | |
private: | |
std::wstring m_value; | |
public: | |
CppClass(std::wstring& value): m_value(value){ } | |
std::wstring& value() { return m_value; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
enum ZunDoko :Int { | |
case ズン | |
case ドコ | |
static func createRandom() -> ZunDoko { | |
return ZunDoko(rawValue: Int(arc4random_uniform(2)))! | |
} | |
} |