C ++字符串的运算符是什么意思?

时间:2018-07-17 09:15:10

标签: c++ string stl operator-overloading std

在C ++代码中我找到了一行

SELECT * FROM post AS a WHERE a.lang = "fr" OR ( a.lang = "en" AND ( SELECT COUNT(*) FROM post AS b WHERE b.lang = "fr" AND b.postid = a.postid ) = 0 ) GROUP BY a.postid

在Visual Studio 12上越过此行时,std::string fruit = "" / "apple";变量最终包含 apple 。 但是 fruit的此运算符是什么意思?/

1 个答案:

答案 0 :(得分:1)

C ++标准库没有为mydist <- dist(DATABASE) clusters <- cutree(hclust(mydist), k = 3) ## Col means in each cluster apply(DATABASE, 2, function (x) tapply(x, clusters, mean)) ## or DATABASE$cluster <- clusters # add cluster to DATABASE # Now take means per group library(dplyr) centroids <- DATABASE %>% group_by(cluster) %>% summarise_all(funs(mean)) ## Distance between centroids dist(centroids[, -1], method = "euclidean") ## Example for distance in cluster 1 (distance between all observations of cluster 1) DATABASE %>% filter(cluster == 1) %>% select(-cluster) %>% dist() string定义除法运算符。所以这个code won't compile by itself

您可能在代码的其他地方有一个重载,该重载需要两个字符串或两个const char[N],而实际上确实将其两个操作数连接在一起,即

const char[]