我有一个unordered_set<shared_ptr<T>> us
,我想知道k
针us
是否在k
,shared_ptr<T const>
类型unordered_set<shared_ptr<T>>::find
是const_cast
抱怨它无法转换。
有解决方法吗?也许直接提供哈希?
我确实尝试import React from 'react';
import { StatusBar, StyleSheet, Text, View, TouchableOpacity, Animated, Easing, Dimensions } from 'react-native';
import styles from './AppStyleSheet'
export default class App extends React.Component {
constructor (props) {
super(props);
let screenWidth = Dimensions.get('window').width,
screenHeight = Dimensions.get('window').height;
this.state = {
MainPosition: [styles.main, {width: screenWidth * 2}, {height: screenHeight}, {marginTop: 0}, {marginLeft: 0}],
paneDimensions: [styles.pane, {width: screenWidth}, {height: screenHeight}]
}
}
SlidePane =(direction)=> {
let screenHeight = Dimensions.get('window').height,
screenWidth = Dimensions.get('window').width,
theTopMargin,
theLeftMargin;
if (direction === 'right') {
theLeftMargin = parseInt('-' + screenWidth)
}
this.setState({
MainPosition: [styles.main, {width: screenWidth * 2}, {height: screenHeight}, {marginTop: 0}, {marginLeft: theLeftMargin}]
})
}
render() {
return (
<View style={this.state.MainPosition}>
<StatusBar hidden />
<View style={this.state.paneDimensions}>
<View style={styles.buttonsContainer}>
<TouchableOpacity style={styles.button} onPress={() => this.SlidePane('right')}>
<Text style={styles.buttonText}>Slide Right</Text>
</TouchableOpacity>
</View>
</View>
<View style={this.state.paneDimensions}>
<Text style={styles.paneText}>Right Pane</Text>
</View>
</View>
); // end return
} // end render
} // end export
(感觉很脏),但没有削减它。
答案 0 :(得分:10)