[{"@context":"http:\/\/schema.org\/","@type":"BlogPosting","@id":"https:\/\/wiki.edu.vn\/jp\/wiki22\/archives\/287153#BlogPosting","mainEntityOfPage":"https:\/\/wiki.edu.vn\/jp\/wiki22\/archives\/287153","headline":"\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50 – Wikipedia","name":"\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50 – Wikipedia","description":"before-content-x4 \u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50 (\u308a\u3088\u3046\u3057\u3083\u3066\u3044\u304e\u3048\u3093\u3056\u3093\u3057[1][2]\u82f1: user-defined operators[3][4]) \u3068\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u304a\u3044\u3066\u3001\u8a00\u8a9e\u306e\u5229\u7528\u8005\u304c\u6f14\u7b97\u5b50\u306b\u5bfe\u3057\u7d44\u307f\u8fbc\u307f\u306e\u6f14\u7b97\u5b50\u3068\u306f\u7570\u306a\u308b\u52d5\u4f5c\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3042\u308b\u3002 \u53e4\u304f\u306fFORTRAN\u304b\u3089\u5c0e\u5165\u3055\u308c\u305f\u6a5f\u80fd\u3067\u3042\u308b\u3002\u5f53\u521d\u306f\u53ef\u8aad\u6027\u3068\u8a18\u8ff0\u6027\u306e\u89b3\u70b9\u304b\u3089\u5404\u7a2e\u8a00\u8a9e\u306b\u53d6\u308a\u5165\u308c\u3089\u308c\u305f\u6a5f\u80fd\u3067\u3042\u308b\u304c\u3001Smalltalk\u3068C++\u306b\u3088\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e\u767a\u9054\u3068\u3068\u3082\u306b\u591a\u614b\u6027\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3068\u3057\u3066\u306e\u5074\u9762\u3082\u6301\u3064\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u306f\u3069\u306e\u3088\u3046\u306a\u8a00\u8a9e\u3067\u3082\u95a2\u6570\u307e\u305f\u306f\u30e1\u30f3\u30d0\u30fc\u95a2\u6570\u3042\u308b\u3044\u306f\u30e1\u30bd\u30c3\u30c9\u306e\u3044\u305a\u308c\u304b\u3067\u5b9a\u7fa9\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002 Table of Contents \u6f14\u7b97\u5b50\u5b9a\u7fa9\u306e\u4f8b[\u7de8\u96c6]\u4f7f\u7528\u53ef\u80fd\u306a\u8a00\u8a9e[\u7de8\u96c6]\u8868\u5185\u306e\u6ce8\u8a18[\u7de8\u96c6]\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3068\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50[\u7de8\u96c6]\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u306b\u3088\u308b\u591a\u614b\u6027\u306e\u4f8b[\u7de8\u96c6]\u95a2\u9023\u9805\u76ee[\u7de8\u96c6] \u6f14\u7b97\u5b50\u5b9a\u7fa9\u306e\u4f8b[\u7de8\u96c6] Smalltalk\u306b\u3088\u308b\u4f8b: Object subclass: #Value instanceVariableNames: 'value' classVariableNames: ''","datePublished":"2022-04-26","dateModified":"2022-04-26","author":{"@type":"Person","@id":"https:\/\/wiki.edu.vn\/jp\/wiki22\/archives\/author\/lordneo#Person","name":"lordneo","url":"https:\/\/wiki.edu.vn\/jp\/wiki22\/archives\/author\/lordneo","image":{"@type":"ImageObject","@id":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c9645c498c9701c88b89b8537773dd7c?s=96&d=mm&r=g","height":96,"width":96}},"publisher":{"@type":"Organization","name":"Enzyklop\u00e4die","logo":{"@type":"ImageObject","@id":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","url":"https:\/\/wiki.edu.vn\/wiki4\/wp-content\/uploads\/2023\/08\/download.jpg","width":600,"height":60}},"image":{"@type":"ImageObject","@id":"https:\/\/ja.wikipedia.org\/wiki\/Special:CentralAutoLogin\/start?type=1x1","url":"https:\/\/ja.wikipedia.org\/wiki\/Special:CentralAutoLogin\/start?type=1x1","height":"1","width":"1"},"url":"https:\/\/wiki.edu.vn\/jp\/wiki22\/archives\/287153","about":["Wiki"],"wordCount":4743,"articleBody":" (adsbygoogle = window.adsbygoogle || []).push({});before-content-x4\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50 (\u308a\u3088\u3046\u3057\u3083\u3066\u3044\u304e\u3048\u3093\u3056\u3093\u3057[1][2]\u82f1: user-defined operators[3][4]) \u3068\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u306b\u304a\u3044\u3066\u3001\u8a00\u8a9e\u306e\u5229\u7528\u8005\u304c\u6f14\u7b97\u5b50\u306b\u5bfe\u3057\u7d44\u307f\u8fbc\u307f\u306e\u6f14\u7b97\u5b50\u3068\u306f\u7570\u306a\u308b\u52d5\u4f5c\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3042\u308b\u3002\u53e4\u304f\u306fFORTRAN\u304b\u3089\u5c0e\u5165\u3055\u308c\u305f\u6a5f\u80fd\u3067\u3042\u308b\u3002\u5f53\u521d\u306f\u53ef\u8aad\u6027\u3068\u8a18\u8ff0\u6027\u306e\u89b3\u70b9\u304b\u3089\u5404\u7a2e\u8a00\u8a9e\u306b\u53d6\u308a\u5165\u308c\u3089\u308c\u305f\u6a5f\u80fd\u3067\u3042\u308b\u304c\u3001Smalltalk\u3068C++\u306b\u3088\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u306e\u767a\u9054\u3068\u3068\u3082\u306b\u591a\u614b\u6027\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3068\u3057\u3066\u306e\u5074\u9762\u3082\u6301\u3064\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u306f\u3069\u306e\u3088\u3046\u306a\u8a00\u8a9e\u3067\u3082\u95a2\u6570\u307e\u305f\u306f\u30e1\u30f3\u30d0\u30fc\u95a2\u6570\u3042\u308b\u3044\u306f\u30e1\u30bd\u30c3\u30c9\u306e\u3044\u305a\u308c\u304b\u3067\u5b9a\u7fa9\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002Table of Contents\u6f14\u7b97\u5b50\u5b9a\u7fa9\u306e\u4f8b[\u7de8\u96c6]\u4f7f\u7528\u53ef\u80fd\u306a\u8a00\u8a9e[\u7de8\u96c6]\u8868\u5185\u306e\u6ce8\u8a18[\u7de8\u96c6]\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3068\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50[\u7de8\u96c6]\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u306b\u3088\u308b\u591a\u614b\u6027\u306e\u4f8b[\u7de8\u96c6]\u95a2\u9023\u9805\u76ee[\u7de8\u96c6]\u6f14\u7b97\u5b50\u5b9a\u7fa9\u306e\u4f8b[\u7de8\u96c6]Smalltalk\u306b\u3088\u308b\u4f8b:Object subclass: #Value instanceVariableNames: 'value' classVariableNames: '' poolDictionaries: '' category: 'Example'.Value createGetMethod: 'value' default: 0; createSetMethod: 'value'.Value methodsFor: 'accessing'!species \" \u6f14\u7b97\u5b50\u306e\u623b\u308a\u5024\u578b\u3068\u3057\u3066Value\u81ea\u8eab\u3092\u4f7f\u3046\u3002 \" ^ Value.!!\" '+' \u6f14\u7b97\u5b50\u3068 '-' \u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u3002 \"Value methodsFor: 'operator'!+ aNumber ^ self species with: self value + aNumber.!- aNumber ^ self species with: self value - aNumber.!!Value methodsFor: 'instance creation'!with: aNumber ^ super new value: aNumber.!!| value0 value1 value2 |value1 := Value with: 10.value2 := Value with: 5.\" \u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u305f\u305f\u3081\u5404\u5909\u6570\u306b\u306f\u6574\u6570\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u306f\u306a\u304fValue\u30af\u30e9\u30b9\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4ee3\u5165\u3055\u308c\u3066\u3044\u308b\u3002 \"value0 := value1 + value2.value0 := value1 - value2. (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4Smalltalk\u306b\u304a\u3044\u3066\u306f\u30e1\u30bd\u30c3\u30c9\u306b\u8a18\u53f7\u3060\u3051\u3067\u69cb\u6210\u3055\u308c\u308b\u30bb\u30ec\u30af\u30bf\u30fc[5]\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002Smalltalk\u3067\u306f\u6f14\u7b97\u5b50\u30922\u9805\u30bb\u30ec\u30af\u30bf\u30fc\u3068\u3088\u3073#with:\u306a\u3069\u82f1\u6570\u3067\u3067\u304d\u305f\u30bb\u30ec\u30af\u30bf\u30fc\u3068\u307b\u307c\u540c\u69d8\u306b\u6271\u3046\u3002Smalltalk\u306b\u304a\u3044\u3066\u6f14\u7b97\u5b50\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4e00\u7a2e\u3068\u3044\u3046\u6271\u3044\u3067\u3042\u308a\u5f15\u6570\u304c\u5fc5\u305a1\u500b\u3067\u512a\u5148\u9806\u4f4d\u304c\u7570\u306a\u308b\u70b9\u4ee5\u5916\u306f\u7279\u5225\u6271\u3044\u306f\u3057\u306a\u3044\u3002\u3053\u306e\u305f\u3081\u6f14\u7b97\u5b50\u3068\u3057\u3066\u5b9a\u7fa9\u3067\u304d\u308b\u8a18\u53f7\u306b\u306f\u6b86\u3069\u5236\u9650\u304c\u306a\u3044(\u305f\u3060\u3057\u533a\u5207\u308a\u7528\u306e\u8a18\u53f7\u3084\u4ee3\u5165\u8a18\u53f7\u306f\u6307\u5b9a\u3067\u304d\u306a\u3044)\u3002\u307e\u305f\u3001\u6f14\u7b97\u5b50\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u8a18\u53f7\u306f2\u6587\u5b57\u3067\u3082\u3088\u304f->\u3084~=\u3068\u3044\u3063\u305f\u6f14\u7b97\u5b50\u304c\u3088\u304f\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u3002Smalltalk\u306f\u591a\u91cd\u5b9a\u7fa9\u304c\u3067\u304d\u306a\u3044\u305f\u3081\u4e00\u3064\u306e\u30af\u30e9\u30b9\u306b\u540c\u3058\u6f14\u7b97\u5b50\u3092\u8907\u6570\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002\u305f\u3060\u3057\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u30af\u30e9\u30b9\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u540c\u3058\u30af\u30e9\u30b9\u306b\u7d10\u3065\u304f\u3082\u306e\u306e\u5225\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3042\u308b\u305f\u3081\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30e1\u30bd\u30c3\u30c9\u3068\u30af\u30e9\u30b9\u30e1\u30bd\u30c3\u30c9\u3067\u540c\u3058\u6f14\u7b97\u5b50\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u3063\u3066\u3044\u308b\u3002C++\u306b\u3088\u308b\u4f8b:class Value{ int value;public: Value( int value ): value( value ) { } \/\/ '+' \u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u3002 Value operator + ( Value const &source ) const { return Value( source.value + value ); } \/\/ '-' \u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u3002 Value operator - ( Value const &source ) const { return Value( source.value - value ); } \/\/ \u5358\u9805\u6f14\u7b97\u5b50\u7248\u306e'-'\u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u3002 Value operator - (void) const { return Value( -value ); }};\/\/ \u5927\u57df\u95a2\u6570\u7248\u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u3002Value operator + ( int left, Value const &right ){ return Value( left ) + right;}Value operator - ( int left, Value const &right ){ return Value( left ) - right;}int main(void){ Value value0( 0 ), value1( 10 ), value2( 5 ); \/\/ \u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u3069\u306e\u5909\u6570\u3082\u6570\u5024\u578b\u3067\u306f\u306a\u304fValue\u578b\u306b\u306a\u3063\u3066\u3044\u308b\u3002 value0 = value1 + value2; value0 = value1 - value2; \/\/ \u30e1\u30f3\u30d0\u30fc\u95a2\u6570\u3067\u306f1\u9805\u76ee\u306fValue\u578b\u3067\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u304c\u5927\u57df\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u305f\u30811\u9805\u76ee\u306b\u6570\u5024\u3092\u6307\u5b9a\u3067\u304d\u308b\u3002 value0 = 10 + value2; value0 = 10 - value2; return EXIT_SUCCESS;}C++\u306b\u304a\u3044\u3066\u306foperator\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u5f8c\u306b\u8a18\u53f7\u3092\u3064\u3051\u305f\u5f62\u306e\u7279\u6b8a\u306a\u540d\u524d\u3092\u6301\u3064\u95a2\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u3067\u6f14\u7b97\u5b50\u3092\u5b9a\u7fa9\u3067\u304d\u308b\u3002C++\u3067\u306f\u8a00\u8a9e\u6a5f\u80fd\u3068\u3057\u3066\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u6f14\u7b97\u5b50\u3057\u304b\u5b9a\u7fa9\u3067\u304d\u305a\u72ec\u81ea\u306e\u8a18\u53f7\u3092\u7528\u3044\u305f\u6f14\u7b97\u5b50\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002\u307e\u305f\u3001\u6f14\u7b97\u5b50\u306e\u5f15\u6570\u3084\u623b\u308a\u5024\u306e\u578b\u306f\u6f14\u7b97\u5b50\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u5236\u9650\u3055\u308c\u308b\u3002\u4f8b\u3048\u3070\u578b\u306e\u30e1\u30f3\u30d0\u30fc\u3092\u6307\u5b9a\u3059\u308b->\u6f14\u7b97\u5b50\u3092\u5358\u9805\u6f14\u7b97\u5b50\u3068\u3057\u3066\u72ec\u81ea\u306b\u5b9a\u7fa9\u3057\u305f\u308a\u3001\u6570\u5024\u578b\u3084->\u6f14\u7b97\u5b50\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u306a\u3044\u578b\u3092\u623b\u308a\u5024\u306e\u578b\u3068\u3057\u3066\u6307\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u3002\u591a\u304f\u306e\u5236\u9650\u304c\u3042\u308b\u306a\u304b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u901a\u5e38\u306e\u95a2\u6570\u3068\u7570\u306a\u308b\u6f14\u7b97\u5b50\u72ec\u81ea\u306e\u632f\u308b\u821e\u3044\u3092\u3059\u308b\u6f14\u7b97\u5b50\u304c\u3042\u308a\u901a\u5e38\u306e\u95a2\u6570\u3067\u306f\u4e0d\u53ef\u80fd\u306a\u69cb\u6587\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3002Smalltalk\u3067\u306f2\u9805\u6f14\u7b97\u5b50\u3057\u304b\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u304c+x -x\u3068\u3044\u3063\u305f\u5358\u9805\u6f14\u7b97\u5b50\u306f\u52ff\u8ad6x[i]\u3068\u3044\u3063\u305f\u6dfb\u5b57\u6f14\u7b97\u5b50\u3084x( a, b, c )\u3068\u3044\u3063\u305f\u95a2\u6570\u547c\u51fa\u6f14\u7b97\u5b50\u306a\u3069\u3082\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002C++\u306f\u591a\u91cd\u5b9a\u7fa9\u304c\u53ef\u80fd\u306a\u8a00\u8a9e\u3067\u3042\u308a\u3001\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u306f\u591a\u91cd\u5b9a\u7fa9\u306e\u67a0\u7d44\u307f\u306b\u5165\u3063\u3066\u3044\u308b\u3002\u3053\u306e\u305f\u3081Smalltalk\u3068\u7570\u306a\u308a\u3001\u5f15\u6570\u304c\u7570\u306a\u308b\u5834\u5408\u306b\u9650\u3063\u3066\u540c\u3058\u540d\u524d\u7a7a\u9593\u3067\u540c\u3058\u540d\u524d\u306e\u6f14\u7b97\u5b50\u3092\u8907\u6570\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u308b\u3002\u305f\u3060\u3057\u3001\u65e2\u5b58\u306e\u6f14\u7b97\u5b50\u3092\u4e0a\u66f8\u304d\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u6570\u5024\u578b\u3060\u3051\u3092\u5f15\u6570\u3068\u3059\u308b\u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u306f\u3067\u304d\u306a\u3044\u3002 (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4\u6f14\u7b97\u5b50\u5ba3\u8a00\u540d\u79f0\u632f\u308b\u821e\u3044\u5fdc\u7528\u4f8boperator Type()\u578b\u5909\u63db\uff08\u30ad\u30e3\u30b9\u30c8\uff09\u6f14\u7b97\u5b50Type \u578b\u3092\u8fd4\u3059\u3002Type \u578b\u3078\u306e\u6697\u9ed9\u7684\u306a\u5909\u63db\u304c\u53ef\u80fd\u3068\u306a\u308b\u3002\u547c\u3073\u51fa\u3057\u306b\u306fstatic_cast\u306a\u3069\u306e\u30ad\u30e3\u30b9\u30c8\u69cb\u6587\u306b\u3088\u308b\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u3082\u4f7f\u3048\u308b\u3002C++11\u4ee5\u964d\u3067\u306f\u3001\u6697\u9ed9\u7684\u306a\u578b\u5909\u63db\u3092\u6291\u6b62\u3057\u3066\u3001\u660e\u793a\u7684\u306a\u578b\u5909\u63db\u3092\u5f37\u5236\u3059\u308bexplicit\u4fee\u98fe\u5b50\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b[6]\u3002\u5fdc\u7528\u4f8b\u306e\u3088\u3046\u306bif\u6587\u3084while\u6587\u306e\u6761\u4ef6\u5f0f\u306a\u3069\u3067\u7528\u3044\u308bbool\u578b\u5909\u63db\u6f14\u7b97\u5b50\u306e\u5b9a\u7fa9\u3068\u3057\u3066\u7528\u3044\u3089\u308c\u308b\u307b\u304b\u3001\u30a2\u30c8\u30df\u30c3\u30af\u5909\u6570\u306e\u30af\u30e9\u30b9\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u5185\u90e8\u578b\u3078\u306e\u6697\u9ed9\u5909\u63db\u306a\u3069\u306b\u3082\u7528\u3044\u3089\u308c\u308b[7]\u3002std::unique_ptr pointer( new std::string( \"hoge\" ) );\/\/ \u4ee5\u4e0b\u3067\u306f std::unique_ptr::operator bool() \u304c\u547c\u3070\u308c\u308b\u3002if( pointer ) { \/* pointer \u5185\u90e8\u3067\u7ba1\u7406\u3055\u308c\u308b\u30dd\u30a4\u30f3\u30bf\u30fc\u304c NULL \u3067\u306a\u3044\u5834\u5408 *\/ }Type operator->()\u30a2\u30ed\u30fc\u6f14\u7b97\u5b50Type \u578b\u3092\u8fd4\u3059\u3002\u901a\u4f8b\u3001\u30dd\u30a4\u30f3\u30bf\u30fc\u578bType*\u3092\u8fd4\u3057\u3001Type\u306e\u30e1\u30f3\u30d0\u30fc\u3092\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u7591\u4f3c\u7684\u306a\u30dd\u30a4\u30f3\u30bf\u30fc\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u5fdc\u7528\u4f8b\u306e\u3088\u3046\u306a\u30b9\u30de\u30fc\u30c8\u30dd\u30a4\u30f3\u30bf\u30fc\u3084\u6392\u4ed6[\u8981\u8aac\u660e]\u306a\u3069\u306e\u305f\u3081\u306b\u3088\u304f\u7528\u3044\u3089\u308c\u308b\u3002 (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4std::shared_ptr pointer( new std::vector() );\/\/ \u4ee5\u4e0b\u3067\u306f std::shared_ptr::pointer operator->() \u304c\u547c\u3070\u308c\u308b\u3002pointer->push_back(0);\/\/ push_back() \u306f std::vector \u306e\u30e1\u30f3\u30d0\u30fc\u3060\u304c\u3001std::shared_ptr \u306e\u30e1\u30f3\u30d0\u30fc\u3067\u306f\u306a\u3044\u3002\u4f7f\u7528\u53ef\u80fd\u306a\u8a00\u8a9e[\u7de8\u96c6]\u72ec\u81ea\u306e\u6f14\u7b97\u5b50\u5b9a\u7fa9\u7a2e\u985e\u306e\u5236\u9650\u591a\u91cd\u5b9a\u7fa9FORTRAN\u53ef\u80fd\u306a\u3057\u3042\u308aALGOL\u53ef\u80fd\u306a\u3057\u3042\u308aSmalltalk\u53ef\u80fd\u306a\u3057\u306a\u3057C++\u4e0d\u53ef\u3042\u308a\u3042\u308aProlog\u53ef\u80fd\u306a\u3057\u306a\u3057Haskell\u53ef\u80fd\u3042\u308a\u306a\u3057OCaml\u53ef\u80fd\u3042\u308a\u3042\u308aScala\u53ef\u80fd\u3042\u308a\u3042\u308aRuby\u4e0d\u53ef\u3042\u308a\u306a\u3057Python\u4e0d\u53ef\u3042\u308a\u306a\u3057C#\u4e0d\u53ef\u3042\u308a\u3042\u308aVisual Basic .NET\u4e0d\u53ef\u3042\u308a\u3042\u308aPL\/SQL\u4e0d\u53ef\u306a\u3057\u3042\u308aPL\/pgSQL\u4e0d\u53ef\u306a\u3057\u3042\u308aNim\u53ef\u80fd\u306a\u3057\u3042\u308aKotlin\u4e0d\u53ef\u3042\u308a\u306a\u3057\u8868\u5185\u306e\u6ce8\u8a18[\u7de8\u96c6]\u72ec\u81ea\u306e\u6f14\u7b97\u5b50\u5b9a\u7fa9\u7d44\u307f\u8fbc\u307f\u306e\u6f14\u7b97\u5b50\u3068\u3057\u3066\u5b58\u5728\u3057\u306a\u3044\u8b58\u5225\u5b50\u3092\u6f14\u7b97\u5b50\u3068\u3057\u3066\u5b9a\u7fa9\u3067\u304d\u308b\u3002\u7a2e\u985e\u306e\u5236\u9650\u6a19\u6e96\u306e\u6f14\u7b97\u5b50\u306e\u4e2d\u306b\u518d\u5b9a\u7fa9\u3067\u304d\u306a\u3044\u6f14\u7b97\u5b50\u304c\u5b58\u5728\u3059\u308b\u3002\u305f\u3060\u3057\u4ee3\u5165\u5f0f\u306b\u3064\u3044\u3066\u306fC++\u4ee5\u5916\u3067\u5b9a\u7fa9\u3067\u304d\u308b\u8a00\u8a9e\u306f\u6b86\u3069\u306a\u3044\u305f\u3081\u5236\u9650\u3068\u3057\u3066\u3044\u306a\u3044\u3002\u591a\u91cd\u5b9a\u7fa9\u6f14\u7b97\u5b50\u3068\u3057\u3066\u591a\u91cd\u5b9a\u7fa9\u304c\u53ef\u80fd\u3067\u3042\u308b\u3053\u3068\u3002\u95a2\u6570\u306e\u591a\u91cd\u5b9a\u7fa9\u304c\u3067\u304d\u3066\u3082\u6f14\u7b97\u5b50\u306f\u591a\u91cd\u5b9a\u7fa9\u3067\u304d\u306a\u3044\u5834\u5408\u3082\u3042\u308b\u3002\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u3068\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50[\u7de8\u96c6]\u3044\u304f\u3064\u304b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e\u3067\u306fFORTRAN\u3068\u540c\u3058\u53ef\u8aad\u6027\u3068\u8a18\u8ff0\u6027\u306e\u89b3\u70b9\u3067\u5c0e\u5165\u3055\u308c\u3066\u3044\u308b\u304c\u3001\u591a\u304f\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e\u306b\u304a\u3044\u3066\u306f\u6570\u5024\u578b\u3068\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u540c\u4e00\u306e\u95a2\u6570(\u3042\u308b\u3044\u306f\u30e1\u30bd\u30c3\u30c9)\u3067\u51e6\u7406\u3059\u308b\u89b3\u70b9\u3067\u5c0e\u5165\u3055\u308c\u3066\u304a\u308a\u305d\u308c\u3089\u306e\u8a00\u8a9e\u3067\u306f\u5fc5\u9808\u306e\u6a5f\u80fd\u3068\u306a\u3063\u3066\u3044\u308b\u3002\u7d14\u7c8b\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6307\u5411\u8a00\u8a9e(\u7279\u306bSmalltalk)\u306b\u304a\u3044\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5bfe\u3059\u308b\u64cd\u4f5c\u306f\u5168\u3066\u30e1\u30bd\u30c3\u30c9\u3067\u53d7\u4fe1\u53ef\u80fd\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3057\u3066\u8868\u3055\u308c\u308b\u3079\u304d\u3067\u3042\u308a\u3001\u30bb\u30ec\u30af\u30bf\u30fc\u304c\u8a18\u53f7\u306b\u306a\u3063\u3066\u3044\u308b\u3060\u3051\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3067\u3042\u308b\u6f14\u7b97\u5b50\u306f\u7279\u5225\u6271\u3044\u3059\u3079\u304d\u3067\u306f\u306a\u3044\u3002\u3053\u306e\u305f\u3081\u512a\u5148\u5ea6\u306e\u9055\u3044\u306f\u3042\u308b\u3082\u306e\u306e\u6f14\u7b97\u5b50\u306f\u5358\u306a\u308b\u30bb\u30ec\u30af\u30bf\u30fc\u306e\u4e00\u7a2e\u3068\u3057\u3066\u4f4d\u7f6e\u3065\u3051\u3089\u308c\u3066\u3044\u308b\u3002\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50\u306b\u3088\u308b\u591a\u614b\u6027\u306e\u4f8b[\u7de8\u96c6]Smalltalk\u306b\u3088\u308b\u4f8b:| center result |\"\u4e2d\u592e\u4f4d\u7f6e\u3092\u8fd4\u3059\u30d6\u30ed\u30c3\u30af\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\"center :=[ :edge0 :edge1 | ( edge0 + edge1 ) \/ 2.].\"\u30b9\u30ab\u30e9\u30fc\u5024\u540c\u58eb\u306e\u4e2d\u592e\u4f4d\u7f6e\u3092\u7b97\u51fa\"result := center value: 10 value: 5.\"\u5ea7\u6a19\u540c\u58eb\u306e\u4e2d\u592e\u4f4d\u7f6e\u3092\u7b97\u51fa\"result := center value: 10 @ 10 value: 5 @ 5.C++\u306b\u3088\u308b\u4f8b:\/\/ \u5f15\u6570\u306e\u578b\u3092\u623b\u308a\u5024\u69d8\u306e\u578b\u306b\u5909\u63db\u3059\u308b\u578b\u5b9a\u7fa9template struct Traits{ typedef Type Vector;};template struct Traits{ typedef off_t Vector;};template struct Traits{ typedef std::complex Vector;};\/\/ \u4e2d\u592e\u4f4d\u7f6e\u3092\u8fd4\u3059\u95a2\u6570template typename Traits::Vector Center( Type const &edge0, Type const &edge1 ){ return ( edge0 + edge1 ) \/ 2; \/\/ \u9664\u7b97\u6f14\u7b97\u5b50\u306e\u5b9f\u4f53\u306fCenter\u306e\u5f15\u6570\u306b\u3088\u3063\u3066\u5909\u308f\u308b}int main(void){ int value; \/\/ \u30b9\u30ab\u30e9\u30fc\u5024\u540c\u58eb\u306e\u4e2d\u592e\u4f4d\u7f6e\u3092\u7b97\u51fa int result0 = Center( 10, 5 ); \/\/ \u30a2\u30c9\u30ec\u30b9\u540c\u58eb\u306e\u4e2d\u592e\u4f4d\u7f6e\u3092\u7b97\u51fa off_t result1 = Center( &value + 10, &value + 5 ); \/\/ \u8907\u7d20\u6570\u540c\u58eb\u306e\u4e2d\u592e\u5024\u3092\u7b97\u51fa std::complex result2 = Center( std::complex( 10, 10 ), std::complex( 5, 5 ) ); return EXIT_SUCCESS;}^ https:\/\/web.kudpc.kyoto-u.ac.jp\/Archives\/PDF\/NewsLetter\/kouhou_f90_3.pdf^ http:\/\/www.rs.kagu.sut.ac.jp\/yama\/f90\/INTERFACE_.html^ https:\/\/msdn.microsoft.com\/en-us\/library\/ds533389.aspx^ https:\/\/docs.oracle.com\/database\/121\/SQLRF\/operators007.htm#SQLRF51172^ \u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u30e1\u30bd\u30c3\u30c9\u3092\u7d10\u3065\u3051\u308b\u540d\u524d\u3002Smalltalk\u3067\u306f\u4e00\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u8907\u6570\u306e\u30bb\u30ec\u30af\u30bf\u30fc\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002^ \u660e\u793a\u7684\u306a\u578b\u5909\u63db\u6f14\u7b97\u5b50\u306e\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9 – cpprefjp C++\u65e5\u672c\u8a9e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9^ atomic::operator T – cpprefjp C++\u65e5\u672c\u8a9e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u95a2\u9023\u9805\u76ee[\u7de8\u96c6] (adsbygoogle = window.adsbygoogle || []).push({});after-content-x4"},{"@context":"http:\/\/schema.org\/","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https:\/\/wiki.edu.vn\/jp\/wiki22\/#breadcrumbitem","name":"Enzyklop\u00e4die"}},{"@type":"ListItem","position":2,"item":{"@id":"https:\/\/wiki.edu.vn\/jp\/wiki22\/archives\/287153#breadcrumbitem","name":"\u5229\u7528\u8005\u5b9a\u7fa9\u6f14\u7b97\u5b50 – Wikipedia"}}]}]