Upgrade to Pro — share decks privately, control downloads, hide ads and more …

PropertyObserverとinoutでやらかした話

r-plus
March 23, 2017

 PropertyObserverとinoutでやらかした話

potatotips #38 slide

r-plus

March 23, 2017
Tweet

More Decks by r-plus

Other Decks in Technology

Transcript

  1. 1SPQFSUZ0CTFSWFSͱ
    JOPVUͰ΍Β͔ͨ͠࿩
    QPUBUPUJQT
    !S@QMVT

    View full-size slide

  2. ۨ৔େथ !S@QMVT

    )"/%4-"#*/$

    View full-size slide

  3. ͱ͋ΔରԠͰ3Y4XJGUͷ
    EJTUJODU6OUJM$IBOHFE
    Λ֎ͨ͠όʔδϣϯΛϦϦʔε

    View full-size slide

  4. ϦϦʔε೔ͷ$SBTIঢ়گ

    View full-size slide

  5. ϦϦʔε೔ͷ$SBTIঢ়گ

    View full-size slide

  6. ໌Β͔ʹແݶϧʔϓ

    View full-size slide

  7. ແݶϧʔϓίʔυ
    UPUBM"NPVOU0CTFSWBCMFͰߦ͍ͬͯͨ
    EJTUJODU6OUJM$IBOHFE
    Λফͨ͠ͱ͜Ζൃੜ

    View full-size slide

  8. ແݶϧʔϓίʔυ
    ॾ৚݅Λຬͨͨ͠ΒUSBOTBDUJPOͷ৘ใΛ
    <4USJOH"OZ>ʹม׵ͯ͠ૹ৴͢Δॲཧ
    ม׵ʹ͸0CKFDU.BQQFSͷUP+40/Λར༻

    View full-size slide

  9. )FBSTU%%0CKFDU.BQQFS

    View full-size slide

  10. .BQQBCMFϓϩτίϧʹద߹ͤ͞NBQQJOHΛॻ͍͓ͯ͘ͱ
    *OTUBODFˠUP+40/ɺGSPN+40/ˠJOTUBODF
    ͷ྆ํ͕ग़དྷΔศརͳϠπ

    View full-size slide

  11. 0CKFDU.BQQFSಠࣗΦϖϨʔλ

    View full-size slide

  12. Ұͭͷهड़ͰUP+40/ GSPN+40/
    ͷ྆ํʹରԠͤ͞ΔͨΊʹɺ࣮૷ʹ
    ͸JOPVU͕ར༻͞Ε͍ͯΔ
    public func <- (left: inout T, right: Map)

    View full-size slide

  13. $ͷϙΠϯλ౉͠
    ͷΑ͏ͳ΋ͷ

    View full-size slide

  14. ϙΠϯλΛ͍͡Βͳ͚Ε͹
    Կ΋ى͖ͳ͍ͩΖ͏

    View full-size slide

  15. ϙΠϯλΛ͍͡Βͳ͚Ε͹
    Կ΋ى͖ͳ͍ͩΖ͏
    /P❌

    View full-size slide

  16. ࣮ߦ݁Ռɿ
    OBNFTFUUPB
    OBNFTFUUPB

    View full-size slide

  17. OBNFͷϓϩύςΟΦϒβʔόʔ͸
    zBzΛ୅ೖͨ࣌͠ͱ
    TPNFͷϝιουऴྃޙ
    ͷ߹ܭճ࣮ߦ͞ΕΔ

    View full-size slide

  18. JOPVUΛ࣮ݱ͢ΔͨΊʹ
    ϝιουऴྃޙʹॻ͖໭͕͠ൃੜ͢Δ

    View full-size slide

  19. ͭ·Γ0CKFDU.BQQFSͰ
    ΠϯελϯεΛ+40/ʹม׵͢Δͱ
    ݩΦϒδΣΫτͷ֤ϓϩύςΟʢϚοϐϯ
    άର৅ʹͨ͠΋ͷʣͷTFUUFS͕Α͹ΕΔ

    View full-size slide

  20. ແݶϧʔϓίʔυ
    0CKFDU.BQQFSͷ+40/ม׵͕࣮ߦ͞Ε
    JOPVUʹΑͬͯ஋͸มΘͬͯͳ͍͚ΕͲϓ
    ϩύςΟʹ୅ೖ͞Ε
    0CTFSWBCMFʹγάφϧ͕ඈΜͰ͘Δ
    ҎԼϧʔϓ

    View full-size slide

  21. ·ͱΊ
    ϓϩύςΟͷ0CTFSWFS
    ʢ4XJGUͷ1SPQFSUZ0CTFSWFS 0CKDͷ,70౳ʣ
    Ͱߦ͏ॲཧͷهड़Ͱ
    JOPVUͷϝιουΛར༻͢Δ࣌͸஫ҙ͠·͠ΐ͏ɻ

    View full-size slide

  22. ͪͳΈʹ
    IUUQTHJUIVCDPN3FBDUJWF,JU#POECMPCW#POE$PSF&WFOU1SPEVDFSTXJGU-
    3Y4XJGUҠߦલʹར༻͍ͯͨ͠
    3FBDUJWF,JU#POE
    Ͱ͸ɺ0CTFSWFS࣮ߦதͷγάφϧΛΨʔυ͍ͯ͠·ͨ͠

    View full-size slide