Closed shewer closed 3 years ago
如題 不是很了解 爲何 empty 會是 .empty types.cc methods 都是 用 WRAPMEN(T::empty) 請問如何改成 :empty() 在套一層 bool empty1(T &t) { return T.empty() } 就可以用 :empty()
lua method table:func() --> table.func( self)
https://github.com/rime/librime/blob/bb8c2631402118b6d7c8df7ce63db0352244bd47/src/rime/menu.cc#L72 class Menu https://github.com/rime/librime/blob/bb8c2631402118b6d7c8df7ce63db0352244bd47/src/rime/segmentation.h#L59 class Segmentation : public vector {
===============test empty1 composition & segmention .empty =========================== segmention.empty() 7LuaTypeIRN4rime12SegmentationEE: 0x55652b4c0358 true segmention:empty1() 7LuaTypeIRN4rime12SegmentationEE: 0x55652b4c0358 false composition.empty() 7LuaTypeIRN4rime11CompositionEE: 0x55652b4c04b8 true composition:empty1() 7LuaTypeIRN4rime11CompositionEE: 0x55652b4c04b8 false
fixed in #88
如題 不是很了解 爲何 empty 會是 .empty types.cc methods 都是 用 WRAPMEN(T::empty) 請問如何改成 :empty() 在套一層 bool empty1(T &t) { return T.empty() } 就可以用 :empty()
lua method table:func() --> table.func( self)
https://github.com/rime/librime/blob/bb8c2631402118b6d7c8df7ce63db0352244bd47/src/rime/menu.cc#L72 class Menu https://github.com/rime/librime/blob/bb8c2631402118b6d7c8df7ce63db0352244bd47/src/rime/segmentation.h#L59 class Segmentation : public vector {
===============test empty1 composition & segmention .empty =========================== segmention.empty() 7LuaTypeIRN4rime12SegmentationEE: 0x55652b4c0358 true segmention:empty1() 7LuaTypeIRN4rime12SegmentationEE: 0x55652b4c0358 false composition.empty() 7LuaTypeIRN4rime11CompositionEE: 0x55652b4c04b8 true composition:empty1() 7LuaTypeIRN4rime11CompositionEE: 0x55652b4c04b8 false