Object as a key in a map container
조회 수: 7 (최근 30일)
이전 댓글 표시
I have two different class types. Can I use in the map container one as a value and the other as a key?
댓글 수: 0
채택된 답변
Adam
2017년 6월 2일
No. Keys are restricted to:
'Possible values are 'char', 'double', 'single', 'int32', 'uint32', 'int64', or 'uint64'.'
So I guess if your class inherits from one of these then you can (I don't think I have tried this), but not otherwise.
댓글 수: 0
추가 답변 (1개)
Feilin Jia
2018년 2월 12일
No. I have the same question with you. I tried, but it gives me error. The key must be a number or character.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!