FieldSet TableInfo::genFieldSet(UINT index, const FieldSet &fields) const { const IndexDefinition &indexDef = m_indexArray[index]; FieldSet keyFieldSet; for(size_t i = 0; i < fields.size(); i++) { int j = indexDef.getFieldIndex(fields[i]); if(j < 0) { throwSqlError(SQL_FATAL_ERROR,_T("Column %d is not member of index %s in table %s\n") ,fields[i],indexDef.m_indexName.cstr(),m_fileName.cstr()); } keyFieldSet.add(j); } return keyFieldSet; }
int main(int argc, char** argv) { if (argc != 2) return -1; int n = std::atoi(argv[1]); std::cout << n << " queens" << std::endl; Field field(n); FieldSet result; depth_first(field, result); std::cout << "found " << result.size() << " solutions." << std::endl; return 0; }